简体   繁体   English

在Project.Build的程序中使用2013 msbuild

[英]Using 2013 msbuild in program with Project.Build

Our tests use Microsoft.Build.Evaluation.Project.Build to build projects. 我们的测试使用Microsoft.Build.Evaluation.Project.Build来构建项目。

Works fine for VS 2010 & 2012. Trouble is in VS 2013, it picks up msbuild from 适用于VS 2010和2012.在VS 2013中遇到麻烦,它会从中获取msbuild

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

ver 4.0.30319.18408

instead of from VS 2013 而不是从VS 2013

C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe

ver 12.0.21005.1

Is there any method to ask it to pick up the VS 2013 msbuild? 有没有办法要求它拿起VS 2013 msbuild? May be adding to the .proj file or setting an environment value before calling the build method? 可能在调用构建方法之前添加到.proj文件或设置环境值?

MSBuild and its Toolset now Version with Visual Studio MSBuild及其工具集现在使用Visual Studio版本

We plan to evolve our build tools with each version of Visual Studio from now on. 我们计划从现在开始使用每个版本的Visual Studio来构建我们的构建工具。 Each release of the Micrsoft® Build Tools will have a new version of MSBuild, the VB/C# Compilers, and Toolset. 每个版本的Micrsoft®BuildTools都将推出新版本的MSBuild,VB / C#编译器和工具集。 They will all version together. 他们将一起版本。 Visual Studio will use its corresponding version of MSBuild exclusively. Visual Studio将独占使用其相应版本的MSBuild。 For instance, Visual Studio 2013 will exclusively use MSBuild 2013 and ToolsVersion=”12.0”. 例如,Visual Studio 2013将专门使用MSBuild 2013和ToolsVersion =“12.0”。 To align with Visual Studio's versioning we have updated MSBuild's assembly version from 4.0 to 12.0 as well. 为了与Visual Studio的版本控制保持一致,我们还将MSBuild的程序集版本从4.0更新到12.0。

And a link to the visual studio team page, with a few additional defaults to check 还有一个指向visual studio团队页面的链接,还有一些额外的默认值可供检查

http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx

however 4.0 and version 12 are the same; 但4.0和版本12是相同的; re-versioned to support the visual studio version number format 重新版本化以支持visual studio版本号格式

from: 从:

http://en.wikipedia.org/wiki/.NET_Framework_version_history#.NET_Framework_4.5 http://en.wikipedia.org/wiki/.NET_Framework_version_history#.NET_Framework_4.5

//Quote// .NET Framework 4.5 was released on 15 August 2012.,[27] a set of new or improved features were added into this version.[28] //引用// .NET Framework 4.5于2012年8月15日发布。[27]在此版本中添加了一组新的或改进的功能。[28] The .NET Framework 4.5 is only supported on Windows Vista or later.[29][30] .NET Framework 4.5仅在Windows Vista或更高版本上受支持。[29] [30] The .NET Framework 4.5 uses Common Language Runtime 4.0, with some additional runtime features.[31] .NET Framework 4.5使用公共语言运行时4.0,以及一些额外的运行时功能。[31] //End Quote //结束报价

Since 4.5 is an "upgrade" to the 4.0 library......."C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\" is where I would expect it to find its version of MsBuild.exe. 由于4.5是4.0库的“升级”.......“C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319 \\”是我希望它找到它的MsBuild.exe版本的地方。

Are the MSBuild.Exe (that you list) different? MSBuild.Exe(您列出的)是否不同?

You could experiment with overriding the 你可以尝试覆盖

 <Message Text=" MSBuildBinPath  = $(MSBuildBinPath)" /> 

property. 属性。

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

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