当我们安装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()
===================
这似乎发生在我们第一次构建解决方案然后停止发生一段时间然后又回来然后消失了一段时间。有想法该怎么解决这个吗?因为我只运行VS2013&在具有8GB RAM的64位系统上的几个IE实例。
答案 0 :(得分:10)
安装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的版本。
我也试过@J.J.Hashemi提到的amd64版本,但是它给了我一些关于某些框架DLL的处理器架构的令人讨厌的警告,这些框架DLL与我的目标架构不匹配。
答案 1 :(得分:6)
我通过用C:\ Program Files(x86)\ MSBuild \ 12.0 \ Bin \ amd64
替换C:\ Program Files(x86)\ MSBuild \ 12.0 \ Bin来解决这个问题