久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

強制 BuildManager 使用另一個版本的 MSBuild

Force BuildManager to use another version of MSBuild(強制 BuildManager 使用另一個版本的 MSBuild)
本文介紹了強制 BuildManager 使用另一個版本的 MSBuild的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

以下代碼嘗試使用 BuildManager 以編程方式構建解決方案:

The following code tries to build a Solution programmatically, using BuildManager:

ProjectCollection pc = new ProjectCollection();
pc.DefaultToolsVersion = "12.0";
pc.Loggers.Add(fileLogger);
Dictionary<string, string> globalProperty = new Dictionary<string, string>();
BuildRequestData buildRequest = new BuildRequestData(solutionName, globalProperty, null, new[] { "Build" }, null);

BuildParameters buildParameters = new BuildParameters(pc)
{
    DefaultToolsVersion = "12.0",
    OnlyLogCriticalEvents = false,
    DetailedSummary = true,
    Loggers = new List<Microsoft.Build.Framework.ILogger> { fileLogger }.AsEnumerable()
};

var result = BuildManager.DefaultBuildManager.Build(buildParameters, buildRequest);

當我運行這段代碼時,它不會構建任何東西.我可以看到除了 winmdexp.exe 的一個特定版本之外,還使用了以下編譯器 csc.exe:

When I run this code, it doesn't build anything. I can see that the following compiler csc.exe is being used, in addition to one particular version of winmdexp.exe:

C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Csc.exe
ExportWindowsMDFile:
    C:Program Files (x86)Microsoft SDKsWindowsv8.0AinNETFX 4.0 Toolswinmdexp.exe 

但是當我使用 VS IDE 成功構建解決方案時,出現以下信息:

But when I successfully build a solution using VS IDE, the following information comes up:

C:Program Files (x86)MSBuild12.0inCsc.exe
ExportWindowsMDFile:
    C:Program Files (x86)Microsoft SDKsWindowsv8.1AinNETFX 4.5.1 Toolswinmdexp.exe

為什么在我的代碼中會發生這種情況?怎么改?

Why is this happening in my code & how can I change it?

推薦答案

截至 Visual Studio 2013,MSBuild 不再是 .NET Framework 組件.這意味著對打包和部署進行了一些重組.舊的 MSBuild 框架仍然存在于 .NET Framework 文件夾中.但是,當您安裝 Visual Studio 2013 時,Microsoft Build Tools 12.0 也會安裝到 C:Program Files (x86)MSBuild12.0.請注意,構建工具與 Visual Studio 分開提供此處.

As of Visual Studio 2013, MSBuild is no longer a .NET Framework component. This meant some restructuring of packaging and deployment. The old MSBuild framework still lives in the .NET Framework folders. However when you install Visual Studio 2013, the Microsoft Build Tools 12.0 are also installed to C:Program Files (x86)MSBuild12.0. Note that the Build Tools are available separately from Visual Studio here.

當我第一次嘗試這個時,我也遇到了和你一樣的情況.問題是您可能已經引用了舊的4.0"MSBuild Framework 程序集.您需要引用位于 C:Program Files (x86)MSBuild12.0in 中的新 12.0 程序集(您必須在 VS 中瀏覽以添加引用).您可能需要 Microsoft.Build、M??icrosoft.Build.Engine 和 Microsoft.Build.Framework.更新這些參考資料后,我發現它在構建時使用了與 VS 2013 相同的工具.

I encountered the same situation as you as well when I first tried this. The issue is that you probably have referenced the old "4.0" MSBuild Framework assemblies. You need to reference the new 12.0 assemblies located in C:Program Files (x86)MSBuild12.0in (you'll have to browse there in VS to add the references). You probably need Microsoft.Build, Microsoft.Build.Engine, and Microsoft.Build.Framework. Once I updated those references I saw it was using the same tools as VS 2013 when building.

這篇關于強制 BuildManager 使用另一個版本的 MSBuild的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Is there a C# library that will perform the Excel NORMINV function?(是否有執行 Excel NORMINV 函數的 C# 庫?)
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權列表中選擇 x 個隨機元素(無需替換))
Create a summary description of a schedule given a list of shifts(給定輪班列表,創建時間表的摘要描述)
C# Normal Random Number(C# 普通隨機數)
Standard deviation of generic list?(通用列表的標準偏差?)
AsyncCTP: Creating a class that is IAwaitable(AsyncCTP:創建一個 IAwaitable 的類)
主站蜘蛛池模板: 免费视频久久 | 欧美极品少妇xxxxⅹ免费视频 | 日韩成人av在线播放 | 国产一区二区电影网 | 荷兰欧美一级毛片 | 日韩在线观看网站 | 久久99精品久久久久久 | 一二三区av | 成人做爰999 | av手机在线 | 男女羞羞在线观看 | 日韩中文字幕视频在线观看 | 欧美free性| 成人久久18免费网站图片 | 中文字幕日韩欧美一区二区三区 | 亚洲欧美日韩精品久久亚洲区 | 男人天堂手机在线视频 | 欧美日韩在线综合 | 亚洲免费视频在线观看 | 国产在线小视频 | 日韩精品一区二区三区 | 国产成人精品一区二区 | 欧美精品一区二区三区四区五区 | 午夜小电影 | 欧美国产精品 | 久久婷婷色 | 国产高清视频在线观看 | 在线成人| 韩日在线| 国产乱码高清区二区三区在线 | 日韩一区不卡 | 6996成人影院网在线播放 | 99精品欧美一区二区三区综合在线 | 中文字幕在线播放第一页 | 能看的av | 最新中文字幕第一页视频 | 精品一区二区三区在线观看 | 欧洲精品一区 | 精品国产31久久久久久 | 久久久久久九九九九九九 | 男人的天堂久久 |