folibis
folibis

Reputation: 12874

Conditional resource compile

I have c# application. The application includes resource file with images and icon. My target is to compile the same application but with different set of images/icons. Same images name, but different content.

Is there a way to include different resource file in compile time on condition?

Upvotes: 2

Views: 818

Answers (1)

WerWet
WerWet

Reputation: 383

Maybe you are looking for Preprocessor Directives or Conditional Attribute.

Preprocessor directives

From this tutorial by Bipin Joshi:

C# preprocessor directives are commands that are meant for the C# compiler. Using preprocessor directives you instruct the C# compiler to alter the compilation process in some way. For example you may instruct the C# compiler that a particular block of code be excluded from the compilation process.

ConditionalAttribute

From MSDN

Indicates to compilers that a method call or attribute should be ignored unless a specified conditional compilation symbol is defined.

To compare these two see this post.

Upvotes: 2

Related Questions