自升级到VS 2010以来生成错误 [英] Build error since upgrade to VS 2010
问题描述
自从将项目升级到VS2010(包括使用MSBuild v4而不是3.5)(并且未进行任何其他更改)以来,我收到以下构建错误,并且不知道如何修复它.
since upgrading my project to VS2010, including the use of MSBuild v4 instead of 3.5 (and not making any other changes), I get the following build error and have no clue how to fix it.
它仅适用于我项目的x64构建,x86仍然可以正常工作.显然,它尝试从位于"C:\ SVN \ CDBurnerXP \ trunk \ Assemblies"中的x86 DLL构建一个x64互操作程序集.使用x64 DLL执行TlbImp命令时 位于不同的目录中,它可以正常工作.但是,我不知道如何配置我的项目以对x86和x64构建使用不同的COM引用.在其上编译项目的操作系统是WinXP x86.
It only applies to the x64 build of my project, x86 still works fine. Apparently, it tries to build a x64 interop assembly from the x86 DLL located in "C:\SVN\CDBurnerXP\trunk\Assemblies". When executing the TlbImp command with the x64 DLL which is located in a different directory, it works fine. However, I don't know how I can configure my project to use different COM references for the x86 and x64 build. The OS on which the project is being compiled is WinXP x86.
任何帮助将不胜感激.
<target name="ResolveComReferences" success="false">
<message level="high"><![CDATA[C:\Programme\Microsoft SDKs\Windows\v7.0A\bin\TlbImp.exe C:\SVN\CDBurnerXP\trunk\Assemblies\NMSDVDXU.dll /namespace:NMSDVDXLib /machine:X64 /out:obj\x64\Release\Interop.NMSDVDXLib.dll /sysarray /transform:DispRet /reference:C:\SVN\CDBurnerXP\trunk\Assemblies\Bass.Net.dll /reference:C:\SVN\CDBurnerXP\trunk\Assemblies\LogicNP.FileView.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Design.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Management.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:C:\WINDOWS\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll ]]></message>
<error code="TI0000" file="TlbImp"><![CDATA[A single valid machine type compatible with the input type library must be specified.]]></error>
<warning code="MSB3283" file="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets" line="1558" column="9"><![CDATA[Die Wrapperassembly für die Typbibliothek "NMSDVDXLib" wurde nicht gefunden.]]></warning>
<message level="high"><![CDATA[C:\Programme\Microsoft SDKs\Windows\v7.0A\bin\TlbImp.exe C:\SVN\CDBurnerXP\trunk\Assemblies\StarBurnX12.dll /namespace:RocketDivision.StarBurnX /machine:X64 /out:obj\x64\Release\Interop.RocketDivision.StarBurnX.dll /sysarray /transform:DispRet /reference:C:\SVN\CDBurnerXP\trunk\Assemblies\Bass.Net.dll /reference:C:\SVN\CDBurnerXP\trunk\Assemblies\LogicNP.FileView.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Design.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Management.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:C:\WINDOWS\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll ]]></message>
<error code="TI0000" file="TlbImp"><![CDATA[A single valid machine type compatible with the input type library must be specified.]]></error>
<warning code="MSB3283" file="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets" line="1558" column="9"><![CDATA[Die Wrapperassembly für die Typbibliothek "RocketDivision.StarBurnX" wurde nicht gefunden.]]></warning>
</target>
推荐答案
Looks like this: http://blogs.msdn.com/visualstudio/archive/2010/05/07/building-on-cross-targeting-scenarios-and-64-bit-msbuild.aspx, COM references are not resolved on cross targeting scenarios.
-Ilya
这篇关于自升级到VS 2010以来生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!