views:

36

answers:

2

Is it possible to include/exclude certain source files depending on what target is selected in Visual Studio? If possible, how?

A: 

You can do this by having a define in the beginning of the relevant source files. Add a unique identifier to each build configuration, and wrap your source file with:

#if _MY_IDENTIFER
...
#endif

If you want a more robust way, switch so by using nant

Am
A: 

Yes it is possible. Right click on the file you want to exclude and select Properties. You can now set Action to None according to the target.

gregseth