我正在尝试拥有一个包含解决方案文件和项目文件的 TFS 2012 构建定义。
构建运行时,不会构建解决方案。相反,我收到如下警告:
F:\Source\1\MyCode\src\MySolution.sln.metaproj: The specified solution configuration "Release|AnyCPU" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.
这是由一个错误引起的,该错误导致 Visual Studio 使用“AnyCPU”作为解决方案文件的平台,而它使用“AnyCPU”作为项目文件。看: http://connect.microsoft.com/VisualStudio/feedback/details/503935/msbuild-inconsistent-platform-for-any-cpu-between-solution-and-project
有没有一种方法可以配置我的构建以使其在存在问题的情况下仍能正常工作?即,一种将特定平台值传递给特定 sln 构建命令同时将不同值传递给其他命令的方法?
最佳答案
如何编辑您单独构建的 .csproj
并将 Or '$(Platform)' == 'Any CPU'
添加到 Platform
属性的默认条件覆盖/修剪空间?
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' Or '$(Platform)' == 'Any CPU' ">AnyCPU</Platform>
关于visual-studio - 使用相同的 TFS 构建定义构建解决方案和项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24335646/