简体   繁体   English

当解决方案配置与所有项目不匹配时,使用 MS build 构建解决方案

[英]Build a solution with MS build when the solution configuration doesn't match all projects

I have a solution which has a configuration, let's call it A .我有一个具有配置的解决方案,我们称之为A 80% of the projects in that solution also have a configuration A but the rest do not.该解决方案中 80% 的项目也有配置A但其余项目没有。 Although they do need to be built.尽管它们确实需要构建。

When I build with msbuild proj.sol /p:Configuration=A /p:Platform=x64 I get error messages like this当我使用msbuild proj.sol /p:Configuration=A /p:Platform=x64我收到这样的错误消息

error MSB4057: The target "Build" does not exist in the project.

It seams that I can build move of my projects but not the ones where the configuration name does not match the solutions.看来我可以构建项目的移动,但不能构建配置名称与解决方案不匹配的项目。

You need to update your solution configuration 'A' to ensure that the other projects have a valid project configuration for solution configuration 'A'您需要更新您的解决方案配置“A”以确保其他项目具有适用于解决方案配置“A”的有效项目配置

  1. In Visual Studio, go to menu Build > Configuration Manager.在 Visual Studio 中,转到菜单 Build > Configuration Manager。
  2. In the Active Solution Configurations drop down list select configuration 'A'在 Active Solution Configurations 下拉列表中选择配置“A”
  3. Select a configuration that you want to use for each project.选择要用于每个项目的配置。 Note it does not have to be 'A'.请注意,它不必是“A”。 It can be any valid project configuration.它可以是任何有效的项目配置。
  4. Ensure the platform setting is set for the projects as well.确保也为项目设置了平台设置。 They can be different then the solution platform.它们可以与解决方案平台不同。 IE solution x64 but one project might be set to x86. IE 解决方案 x64 但一个项目可能设置为 x86。

msbuild proj.sln /p:Configuration=A /p:Platform=x64 msbuild proj.sln /p:Configuration=A /p:Platform=x64

配置管理器

I've just got the same problem.我刚刚遇到了同样的问题。 It was fixed by installing F# Tools for Visual Studio Express 2012 for Web and restart Xamarin as the steps described in Xamarin forums它已通过安装F# Tools for Visual Studio Express 2012 for Web并按照Xamarin 论坛中描述的步骤重新启动 Xamarin 来修复

The bug was filed here该错误已提交here

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM