简体   繁体   English

为什么我的解决方案在Visual Studio中构建,而不是使用msbuild从命令行构建?

[英]How come my solution builds in Visual Studio but not from the command line using msbuild?

If anyone has any idea where to start troubleshooting this, I'd love to hear it. 如果有人知道从哪里开始排除故障,我很乐意听到。 I just upgraded my project to VS2012, Wix 3.6 and .NET 4.5 and I have like 2000 errors whenever I try to build my using the command line (msbuild): http://i.imgur.com/WSi7X.png 我刚刚将我的项目升级到VS2012,Wix 3.6和.NET 4.5,每当我尝试使用命令行(msbuild)构建我时,我都会遇到2000个错误: http//i.imgur.com/WSi7X.png

It builds fine from Visual Studio, but I get a bunch of errors when msbuild is invoked from the command line like this: http://pastie.org/5102451 它从Visual Studio构建得很好,但是当从命令行调用msbuild时我得到了一堆错误: http//pastie.org/5102451

You should make sure you are using the right tools version in your msbuild file: 您应该确保在msbuild文件中使用正确的工具版本:

Force a tool version with MSBuild from inside the file? 从文件内部强制使用MSBuild的工具版本?

This may not be the case, but I often found that this would trip others up in the team when migrating to a new .net runtime and using msbuild. 情况可能并非如此,但我经常发现,当迁移到新的.net运行时并使用msbuild时,这会让团队中的其他人绊倒。

== Edit == ==编辑==

Sorry just noticed you are running it DIRECTLY on the command line and not through some build script so the above solution may not be 100% relevant, but it may still be that the version of MSBuild being executed is unable to handle your .net runtime, as all it takes is 1 project to fail building and then all dependent projects will fail giving your 1000s of random errors whereas really there is only 1 meaningful error that needs to be addressed. 抱歉,您刚刚注意到您在命令行上直接运行它,而不是通过某些构建脚本运行它,因此上述解决方案可能不是100%相关,但可能仍然是正在执行的MSBuild版本无法处理您的.net运行时,因为只需要1个项目来构建失败,然后所有依赖项目都会失败,给出1000个随机错误,而实际上只有1个有意义的错误需要解决。

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

相关问题 Visual Studio生成解决方案,但命令行中的MSBuild失败 - Visual Studio builds solution but MSBuild from the command line fails 如何使用msbuild从命令行编译我的c#解决方案 - How to compile my c# solution with msbuild from command line 使用C#代码中的msbuild构建Visual Studio解决方案 - Build visual studio solution using msbuild from c# code 使用Visual Studio可以很好地构建项目,但是从命令行失败 - Project builds fine with Visual Studio but fails from the command line 从命令行打开Visual Studio网站(不是解决方案) - Open a visual studio website (not solution) from the command line MSBuild从命令行失败,但从Visual Studio cmd行成功 - MSBuild fails from command Line but succeeds from visual studio cmd line 当我尝试使用 MSBuild 构建我的解决方案时,它会启动 Visual Studio - When I tried to build my solution using MSBuild, its launches Visual Studio Visual Studio构建,但msbuild不构建。 - Visual studio builds but msbuild does not. 通过命令行使用MSBuild而不是在Visual Studio上使用无效的令牌错误 - Invalid Token Errors when using MSBuild via Command Line but not on Visual Studio 用于命令行构建的 MSBuild 与 devenv - MSBuild vs devenv for command line builds
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM