Using MSBuild to Build Multiple Configurations

后端 未结 3 1313
太阳男子
太阳男子 2020-12-05 05:01

I\'m trying to edit my project file to enable me to have a project that builds multiple build configs at once. I\'ve done this using a batching approach and using the MSBuil

3条回答
  •  清歌不尽
    2020-12-05 05:43

    Somthing is amiss in your project file. Consider this XML:

    
      pdbonly
      true
      C:\Folder\Etc\Output\$(Configuration)\ 
      ...
    
    

    Those properties can never be set, since even if $(Configuration) and $(Platform) are empty, they can never match the empty string when concatinated with the bar character; the minimal value for that condition is '|' and not ''. Even if corrected by making the condition compare with '|', you then go on to try to use $(Configuration) in the OutputPath in that PropertyGroup, but $(Configuration) will never have a value at the point it is used. Likewise, where you try to set $(Platform) to 'AnyCPU' it must already have that value. You probably meant to omit the condition on the first PropertyGroup altogether, and you may need to supply default values for $(Configuration) and $(Platform) in an early PropertyGroup with no conditions as well. Diff your whole project against a new project and see if there are any other oddities like this present.

    Also notice that on your override of the "Build" target, you have a redundant Condition on the MSBuild task; with the same condition is on the you don't need it on any of the tasks.

提交回复
热议问题