开发者

Visual Studio pre-build action to skip project build based on condition

In a VS 2008 solution, I have several projects. I run the build on开发者_高级运维 the entire solution with msbuild. Based on the existence of a file on the disk, I want to skip the build for one of the projects. How can I achieve this? Is there a way to use a prebuild action to skip the project build?


PreBuildEvent is used to call custom script in OutDir. There is no special flags to skip building. I know several ways to hack build system and get needed behaviour, but it's not cosher.

1) First of all you can create two solutions (with and without that project). On top of that you can easily create a script which will check existence of the file and call MSBuild to build one or another.

2) You can remove the project from sln, add new simple project (let's say dll) and check existence of the file in BeforeBuild action and call MSBuild to build your custom project. Or you can add this behaviour to the one of the projects in that sln.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜