I can't build multiple configuration(s) of a project at the same time in Visual Studio, but I can with MSBuild

前端 未结 1 1276
温柔的废话
温柔的废话 2021-01-16 13:39

I want to build two configurations at the same time of a project. Let\'s say that when I want to build the release version, but I want to build even the debug version (the o

1条回答
  •  天涯浪人
    2021-01-16 13:53

    You can't build inside Visual Studio because of MSBuild's incremental build mechanism that skips targets marked as already run. The real question here is how to break this incremental build. This question is very related.

    If you build with /verbosity=diag you will notice MSBuild reports a bunch of these:

    Target "AssignTargetPaths" skipped. Previously built successfully.

    Microsoft aware of this behavior and consider this by design.

    A possible workaround, which I strongly advise against it, is invoking the second build using the Exec task. The Exec task is merely a command line shell which will eat everything you will feed it with, but in your case it can break the incremental build chain.

    
    

    0 讨论(0)
提交回复
热议问题