I have application with .resx file. Resx file is simple XML, but after buliding resources save to assembly. So to changing resources i need rebuild my resource assemblies. Is there any way to use resources direct from resx file ?
If you are using the ResourceManager
class to access your resources, you can use the resgen
to compile your .resx
file to a .resources
file. You can then create a new instance of the ResourceManager
class using ResourceManager.CreateFileBasedResourceManager
instead of new ResourceManager(...)
. This allows you to specify a resource file name and a directory to search within.
For an example, take a look at approach B in this tutorial.
As mdm mentioned but not explicit wrote No you can't do that without compilation or without a ResourceManager.CreateFileBasedResourceManager
.
The Resource has a XML structure in the .resx part but this parts just shows the compiler where to find the files which should be included and it only exists in your project and not after the build.
A Resource file is defined as a embedded resource, means it is nested into a assembly. Any change will result in a need for a new compilation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With