Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are string resources (.resx) properties kept in memory?

I have a resource (.resx) file, and it have currently 58 string properties. This amount of string properties can grow..

My doubt is, are those strings kept in memory? If i have 200, will all be kept in memory? Or the the strings are kept in file and the ResourceManager access the file? Or anything else? How this work?

like image 871
Vinicius Ottoni Avatar asked Oct 08 '22 12:10

Vinicius Ottoni


1 Answers

Generally the .resx file is compiled into a .resources with resgen.exe file and stored as an assembly resource within the assembly itself. If you look at the properties of the ResX file in your Visual Studio project, you'll see that the Build Action is Embedded Resource, which is what causes it to become embedded into the assembly. So any time the assembly is loaded you will load the resource file as well. There might be another way to use resource files that does not keep them in memory but this is the normal way they are used.

like image 112
luksan Avatar answered Oct 12 '22 11:10

luksan