finding bad resource strings on compile
-
Hi, We have all strings that were not auto-generated stored in special resource files. I notticed that if the code refers to a non-existent resource string the compiler will not let you know about it, and you will find out things are not right until run time. Do you know of a way to make the compiler tell me about the resource problems? Thanks, Elena
-
Hi, We have all strings that were not auto-generated stored in special resource files. I notticed that if the code refers to a non-existent resource string the compiler will not let you know about it, and you will find out things are not right until run time. Do you know of a way to make the compiler tell me about the resource problems? Thanks, Elena
-
elena12345 wrote: Do you know of a way to make the compiler tell me about the resource problems? Code better :) leppie::AllocCPArticle("Zee blog");
Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.Yeah, thanks a lot :laugh: I am just moving a bunch of code. And a bunch of resource strings have to move from one file to another. So I want to make sure I didn't leave anything out. Don't tell me to architect better. I didn't architect this thing ;P Elena
-
Hi, We have all strings that were not auto-generated stored in special resource files. I notticed that if the code refers to a non-existent resource string the compiler will not let you know about it, and you will find out things are not right until run time. Do you know of a way to make the compiler tell me about the resource problems? Thanks, Elena
The compiler (csc.exe in this case) doesn't care about resource files, just like the resource compiler (resgen.exe) doesn't care about source code.
Microsoft MVP, Visual C# My Articles
-
Yeah, thanks a lot :laugh: I am just moving a bunch of code. And a bunch of resource strings have to move from one file to another. So I want to make sure I didn't leave anything out. Don't tell me to architect better. I didn't architect this thing ;P Elena
You could have an external application use reflection on your assembly to check for completeness. You could do something like create string contants in a certain namespace and have this program use reflection on that namespace to get each string constant. It could then use reflection to make sure the resources contain something named the same thing. You could then make this "check" part of your build.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins