I am currently working on a project which supports multi-language. I have created a resource file (.resx) that contains all the strings that the application uses. The main resource file is embedded into the application (an .exe), and the translations into other languages will be compiled into satellite assemblies. The way I use those strings in my application is by calling:
Resources.ResourceManager.GetString("MyResourceKey");
Now my question is, is there a way to find out if there are strings in the main resource file that are not used by the application? The reason I want to do that is that during development there might be messages that were added there, and then we changed our mind and stopped using the message without removing it from the .resx file. Now we need the translation for the other languages and I’d like to ask the translator only for the messages that are really used.
I’ve seen that it might be possible to do that with code analysis but my version of visual studio doesn’t include code analysis. Are there some free third party tools or some code I could easily write to find that out?
Thanks to all
There is a Delay.FxCop code analysis rule to find unused resources. I haven’t used it, but it may be just what you’re looking for.