2

xVJob.dllという名前のC++/ CLIDLLを使用するVisualStudio2008で開発された.NETアプリケーションがあります。

テストVMで実行しようとすると、SideBySideエラーが発生します。VMはWindowsServer2003SP2を実行しています。

開発マシンですべてを正常に実行およびデバッグできますが、テスト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 "と記載されています。

次のイベントがシステムイベントログに記録されます。

マニフェストで見つかったコンポーネントIDが、要求されたコンポーネントのIDと一致しません

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とランタイムファイルで生成されたマニフェストで異なるランタイムバージョンを取得する理由がわかりません。

助けてください!

4

1 に答える 1

1

この質問への回答は、この問題を解決するのに役立ちました。

アプリはVS2008SP1DLLでは動作しません。以前のバージョンはRTMバージョンで動作します

特に、すべてのプロジェクトのプリプロセッサ設定で_BIND_TO_CURRENT_VCLIBS_VERSIONを定義すると、うまくいったようです。

于 2010-08-19T22:54:09.610 に答える