[英]Visual Studio 2013 and Update 2 (Intermittent Build Errors)
當我們安裝 SP2 時,我們在構建解決方案時開始注意到以下內容:
ERROR C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2348,5): Task host node exited prematurely. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt.
ERROR C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2366,7): The "GenerateResource" task's outputs could not be retrieved from the "FilesWritten" parameter. Object does not match target type.
然后查看我看到的 MSBuild_*.failure.txt 文件之一:
UNHANDLED EXCEPTIONS FROM PROCESS 26072:
=====================
5/20/2014 4:18:22 PM
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Collections.Generic.Dictionary`2.Initialize(Int32 capacity)
at System.Collections.Generic.Dictionary`2..ctor(Int32 capacity, IEqualityComparer`1 comparer)
at Microsoft.Build.BackEnd.NodePacketTranslator.NodePacketReadTranslator.TranslateDictionary(Dictionary`2& dictionary, IEqualityComparer`1 comparer)
at Microsoft.Build.BackEnd.TaskParameter.ReadITaskItem(INodePacketTranslator translator, ITaskItem& wrappedItem)
at Microsoft.Build.BackEnd.TaskParameter.TranslateITaskItemArray(INodePacketTranslator translator)
at Microsoft.Build.BackEnd.TaskParameter.Translate(INodePacketTranslator translator)
at Microsoft.Build.BackEnd.TaskParameter.FactoryForDeserialization(INodePacketTranslator translator)
at Microsoft.Build.BackEnd.NodePacketTranslator.NodePacketReadTranslator.Translate[T](T& value, NodePacketValueFactory`1 factory)
at Microsoft.Build.BackEnd.NodePacketTranslator.NodePacketReadTranslator.TranslateDictionary[T](Dictionary`2& dictionary, IEqualityComparer`1 comparer, NodePacketValueFactory`1 valueFactory)
at Microsoft.Build.BackEnd.TaskHostConfiguration.Translate(INodePacketTranslator translator)
at Microsoft.Build.BackEnd.TaskHostConfiguration.FactoryForDeserialization(INodePacketTranslator translator)
at Microsoft.Build.BackEnd.NodePacketFactory.PacketFactoryRecord.DeserializeAndRoutePacket(Int32 nodeId, INodePacketTranslator translator)
at Microsoft.Build.BackEnd.NodePacketFactory.DeserializeAndRoutePacket(Int32 nodeId, NodePacketType packetType, INodePacketTranslator translator)
at Microsoft.Build.CommandLine.OutOfProcTaskHostNode.DeserializeAndRoutePacket(Int32 nodeId, NodePacketType packetType, INodePacketTranslator translator)
at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.PacketPumpProc()
===================
它似乎發生在我們第一次構建解決方案時,然后停止發生一段時間,然后回來然后消失一段時間。 有想法該怎么解決這個嗎? 我不能內存不足,因為我只在具有 8GB RAM 的 64 位系統上運行 VS2013 和幾個 IE 實例。
在安裝 VS 2013 Update 2 后,我得到了完全相同的行為,但在直接從 Visual Studio 內部編譯時卻沒有。 在我們單獨的構建腳本(Windows“bat”文件的集合)中使用msbuild
時,我遇到了這些錯誤。 這些腳本正在使用
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
幸運的是,這個程序的路徑可以在一個地方為我們所有的腳本配置(通過使用某種包含機制)。 我換了
C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe
現在一切似乎都很好。 后者“MSBuild.exe”似乎是作為“升級 2”的一部分安裝的較新版本,前者是屬於 .NET framework 4 的版本。
我還嘗試了@JJHashemi 提到的 amd64 版本,但它給了我一些關於某些框架 DLL 的處理器架構與我的目標架構不匹配的令人討厭的警告。
我通過用 C:\\Program Files (x86)\\MSBuild\\12.0\\Bin\\amd64 替換 C:\\Program Files (x86)\\MSBuild\\12.0\\Bin 解決了這個問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.