开发者

Include/exclude files depending on target (Visual Studio)

Is it possible to include/exclude certain source files depending on what ta开发者_开发百科rget is selected in Visual Studio? If possible, how?


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜