MSB4018 "ResolveComReference"任务意外失败

3

我目前正在尝试将我们的c++ mfc解决方案从visual studio 2010升级到visual studio 2013。当我尝试构建它时,我收到了错误消息MSB4018,“ResolveComReference”任务意外失败。我启用了融合日志记录,并且这就是它告诉我的:

=== Pre-bind state information ===
LOG: DisplayName = System
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Program Files (x86)/MSBuild/12.0/bin/
LOG: Initial PrivatePath = NULL
Calling assembly : Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. ===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files (x86)/MSBuild/12.0/bin/System.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/MSBuild/12.0/bin/System/System.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/MSBuild/12.0/bin/System.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/MSBuild/12.0/bin/System/System.EXE.

我知道msbuild已经被移动了,但我不明白为什么它试图在msbuild路径中查找System.dll,如何使它在正确的位置查找?

编辑:
我现在也尝试升级到Visual Studio 2012,没有遇到同样的问题,升级到VS2013时,当运行devenv /upgrade时,似乎会完全更改vc++目录下的所有内容(升级到vs2012时未更改)。这可能与此问题有关吗?

编辑2:
在将项目升级到2012后(未运行devenv /upgrade),尝试在vs2013中构建项目,这也没有成功,所以我想问题与此无关...
2个回答

3

启用诊断构建输出后,我发现项目中有3个损坏的COM引用不能加载。删除这些引用解决了构建问题。在VS2010中,它们只显示为警告,但由于某种原因,在VS2013中导致了MSB4018错误。


0

这是你的问题:

LOG: Appbase = file:///C:/Program Files (x86)/MSBuild/12.0/bin/

如果您确实需要将基础文件夹指向另一个文件夹,请在构建系统中修复它。但是,最好重新制作针对2013年的构建系统,而不是修补2010版本。


直接前往微软网站可能是您最好的选择。http://msdn.microsoft.com/en-nz/library/ms252495.aspx - BlamKiwi

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接