开发者

SideBySide problem with debug build on a VM

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:

&开发者_如何学JAVAlt;?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!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜