我有一个使用Visual Studio 2008开发的.NET应用程序,该应用程序使用名为 xVJob.dll 的C ++ / CLI DLL。
当我尝试在测试VM上运行时,我收到了SideBySide错误。 VM正在运行Windows Server 2003 SP2。
我可以在我的开发机器上运行和调试一切正常,但是当我尝试在测试VM上运行它时,它会引发异常:
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembl
y 'xVJob, Version=1.0.3883.15147, Culture=neutral, PublicKeyToken=null' or one o
f its dependencies. This application has failed to start because the application
configuration is incorrect. Reinstalling the application may fix this problem.
(Exception from HRESULT: 0x800736B1)
File name: 'xVJob, Version=1.0.3883.15147, Culture=neutral, PublicKeyToken=null'
---> System.Runtime.InteropServices.COMException (0x800736B1): This application
has failed to start because the application configuration is incorrect. Reinsta
lling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
at Jobs.JobMonitor.MonitorThread()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
我已将Microsoft.VC90.DebugCRT和Microsoft.VC90.DebugMFC文件夹从C:\ Program Files \ Microsoft Visual Studio 9.0 \ VC \ redist \ Debug_NonRedist复制到包含VM上可执行文件的文件夹。
构建xVJob.dll时创建的清单如下所示:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.DebugCRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC90.DebugMFC' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
Debug_NonRedist运行时DLL的清单显示它们是版本version =“ 9.0.30729.4148 ”。
以下事件将记录到系统事件日志中:
清单中找到的组件标识与所请求组件的标识不匹配
第4行的清单或策略文件“... \ Microsoft.VC90.DebugCRT \ Microsoft.VC90.DebugCRT.MANIFEST”中出现语法错误。
这是Microsoft.VC90.DebugCRT.MANIFEST文件的内容:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable></noInheritable>
<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.30729.4148" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
<file name="msvcr90d.dll" hashalg="SHA1" hash="af453f3ee64ff975e704d8241daee695e423e6b8"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>qLOzJNR/6Gg8hHyBY2oMP6cuf4E=</dsig:DigestValue></asmv2:hash></file> <file name="msvcp90d.dll" hashalg="SHA1" hash="7689e9e00acb4d25542085d44724a5759cac93b5"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>ItToY/v0CGa5SMBJskUQJE64qlI=</dsig:DigestValue></asmv2:hash></file> <file name="msvcm90d.dll" hashalg="SHA1" hash="86cfdcb727b087b5bf963d87a14056a10ca46b24"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>QdrglJI4vM+V6T5D6iJv08yi+W0=</dsig:DigestValue></asmv2:hash></file>
</assembly>
我不明白为什么我在使用xVJob.dll和运行时文件生成的清单中获得不同的运行时版本。
请帮忙!
答案 0 :(得分:1)
这个问题的答案帮助我解决了这个问题:
App does not run with VS 2008 SP1 DLLs, previous version works with RTM versions
特别是,在我的所有项目的预处理器设置中定义_BIND_TO_CURRENT_VCLIBS_VERSION似乎已经成功了。