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

删除回忆录丶 提交于 2019-12-07 05:43:49

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/9503887/are-string-resources-resx-properties-kept-in-memory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!