How can I exclude a project from a build in MSBuild?

前端 未结 4 890
孤城傲影
孤城傲影 2020-11-28 09:34

I need to build a solution, but exclude one project. How should I do it?

I searched a lot about this issue, but nothing could help.

An ItemGroup

4条回答
  •  暖寄归人
    2020-11-28 10:15

    The solution suggested by Enrico is the most versatile solution that would work always. An alternative solution might be to use a task directly. This will work for you if you have all your project files under a particular directory, or be able to easily enumerate all projects you want to build (i.e. number of projects in your solution is not very big).

    For example, this MSBuild file will build every project under your current directory except for a specific project:

    
    
      
        
        
      
    
      
        
      
    
    
    

    Then you can build that using command line msbuild /t:BuildAllExceptWixProject

提交回复
热议问题