VM 上调试构建的 SideBySide 问题

发布于 2024-09-15 19:34:24 字数 4894 浏览 8 评论 0原文

我有一个使用 Visual Studio 2008 开发的 .NET 应用程序,它使用名为 xVJob.dll 的 C++/CLI DLL。

当我尝试在测试虚拟机上运行它时,出现 SideBySide 错误。 VM 运行 Windows Server 2003 SP2。

我可以在我的开发计算机上运行和调试一切正常,但是当我尝试在测试虚拟机上运行它时,它会抛出异常:

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()

我已从 C:\ 复制了 Microsoft.VC90.DebugCRT 和 Microsoft.VC90.DebugMFC 文件夹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"。

以下事件将记录到系统事件日志中:

清单中找到的组件标识与请求的组件的标识不匹配

清单或策略文件“...\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST”中存在语法错误” 第 4 行。

这是 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 和运行时文件生成的清单中得到不同的运行时版本。

请帮忙!

I have a .NET application that is developed with Visual Studio 2008 which uses a C++/CLI DLL named xVJob.dll.

I am getting SideBySide errors when I try to run it on a test VM. The VM is running Windows Server 2003 SP2.

I can run and debug everything fine on my development machine, but when I try to run it on the test VM, it throws an exception:

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()

I've copied the Microsoft.VC90.DebugCRT and Microsoft.VC90.DebugMFC folders from C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\Debug_NonRedist to the folder that contains the executables on the VM.

The manifest that is created when the xVJob.dll is built looks like this:

<?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>

The manifests for the Debug_NonRedist runtime DLLs says they are version version="9.0.30729.4148".

The following events are logged to the system event log:

Component identity found in manifest does not match the identity of the component requested

Syntax error in manifest or policy file "...\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST" on line 4.

This is the contents of the Microsoft.VC90.DebugCRT.MANIFEST file:

<?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>

I don't understand why I'm getting different runtime versions in the manifest that is generated with the xVJob.dll and the runtime files.

Please help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独﹏钓一江月 2024-09-22 19:34:24

这个问题的答案帮助我解决了这个问题:

应用程序不能与 VS 2008 SP1 DLL 一起运行,以前的版本可以与 RTM 版本一起运行

特别是,在我的所有项目的预处理器设置中定义 _BIND_TO_CURRENT_VCLIBS_VERSION 似乎已经成功了。

The answers to this question helped me resolve this problem:

App does not run with VS 2008 SP1 DLLs, previous version works with RTM versions

In particular, defining _BIND_TO_CURRENT_VCLIBS_VERSION in my preprocessor settings for all of my projects seems to have done the trick.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文