views:

22

answers:

1

I have a String resource that needs to have different value based on the conditional compile.

How to setup different Resources for different compile macros in Visual Studio 2008 Professional?

+1  A: 

No can do. The resource string is stored in XML format in a .resx file, #ifdef doesn't apply. The Properties.Resources class is autogenerated, any #ifdef you put in the Designer.cs source code file will be lost when the file is re-generated.

Put the #ifdef in the code that retrieves the string. A small static helper method will do the job.

Hans Passant