1

私がc++プログラム(B3DTest.exeなど)を作成するときは、サードパーティのdll(B3DViews.dllなど)に依存します(ベンダーは小さな会社です)。私が書いたプログラムは、dll内の1つの関数をテストするだけで非常に簡単です。プログラムを起動すると(必要なヘッダーファイル、.libファイルと.dllファイルがリンクされています)。私は以下の問題に遭遇します。

The application failed to initialize properly (0xc0150002). Click on OK to terminate 
the application.

メイン関数に入る前にプログラムが終了することがわかりました。vs2008IDEの出力は

LDR: LdrpWalkImportDescriptor() failed to probe e:\tlh1987\vs2008projects\B3DTest\Debug\B3DViews.dll
for its manifest, ntstatus 0xc0150002

プログラムとdllを別のターゲットコンピューターに配置すると、正常に動作します。ですから、私のコンピューターに何か問題があるに違いないと思います。イベントログを検索したところ、以下に3つのイベントが表示されています

EventID: 32
Description: Dependent Assembly Microsoft.VC80.CRT could not be found and Last Error was The referenced     
assembly is not installed on your system.
EventID: 59
Description: Resolve Partial Assembly failed for Microsoft.VC80.CRT. Reference error message: The    
referenced assembly is not installed on your system.
EventID: 59
Description: Generate Activation Context failed for Generate Activation Context
E:\tlh1987\vs2008projects\B3DTest\Debug\B3DViews.dll. Reference error message: The operation completed
successfully.

インターネットを検索して、誰かがインストールすることで同様の問題を修正していることを確認し 、2つのファイルをダウンロードしてインストールしましたMicrosoft Visual C++ 2005 Redistributable PackageMicrosoft Visual C++ 2005 SP1 Redistributable Package (x86).
しかし、それはうまくいきませんでした!インターネット上の別の解決策は、3つのdllとMicrosoft.VC80.MFCフォルダー(4つのdllも含む)を含むMicrosoft.VC80.CRTフォルダーのファイルを配置し、最後に対応するマニフェストファイルをB3DTest.exe(私のプログラム)のディレクトリに配置することです。 。しかし、それでも機能しませんでした!しかし、以下のようevent logに1つしかない場所で何かが変わりました。event error

EventID: 59
Description: Generate Activation Context failed for Generate Activation Context
E:\tlh1987\vs2008projects\B3DTest\Debug\B3DViews.dll. Reference error message: The operation completed
successfully.

誰かが私のコンピューターのVC80.CRTとVC80.MFCのバージョンがB3DViews.dll(ベンダーによって配布されている)のバージョン番号と一致しなかった可能性があると私に言いました。次にB3DViews.dll、emacs.exeを使用してを開き、dllに添付されているマニフェストを検索します。それは以下に言います:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
  <dependentAssembly>
  <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.6195"    
  processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
  </dependentAssembly>
</dependency>
<dependency>
  <dependentAssembly>
  <assemblyIdentity type="win32" name="Microsoft.VC80.MFC" version="8.0.50727.6195" 
processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
  <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0" 
  processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
  </dependentAssembly>
</dependency>
<dependency>
  <dependentAssembly>
  <assemblyIdentity type="win32" name="Microsoft.VC80.MFC" version="8.0.50608.0" 
  processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
  </dependentAssembly>
</dependency>
</assembly>

バージョン番号は私を混乱させました。どうすれば8.0.50727.6195よい8.0.50608.0のでしょうか。バージョン番号は1つである必要があります(上記のように2つではありません)。Microsoft.VC80.CRTdllとMicrosoft.VC80.MFCdll、および対応するマニフェストファイルを見つけました(すべてのバージョン番号は8.0.50727.6195C:\ Windows \ WinSxSにあり、B3DTest.exe(私のプログラム)と同じディレクトリに配置します) 。それも機能しませんでした。問題を理解するために。私はDependency Walker for Win32 (x86)自分のプログラムのプロファイルを作成するためにを使用しましたB3DTest.exe

Started "B3DTEST.EXE" (process 0x680) at address 0x00400000.  Successfully hooked module.
Loaded "NTDLL.DLL" at address 0x7C920000.  Successfully hooked module.
Loaded "KERNEL32.DLL" at address 0x7C800000.  Successfully hooked module.
DllMain(0x7C920000, DLL_PROCESS_ATTACH, 0x00000000) in "NTDLL.DLL" called.
DllMain(0x7C920000, DLL_PROCESS_ATTACH, 0x00000000) in "NTDLL.DLL" returned 1 (0x1).
DllMain(0x7C800000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNEL32.DLL" called.
DllMain(0x7C800000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNEL32.DLL" returned 1 (0x1).
Injected "DEPENDS.DLL" at address 0x08370000.
DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "DEPENDS.DLL" called.
DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "DEPENDS.DLL" returned 1 (0x1).
Loaded "B3DVIEWS.DLL" at address 0x10000000.  Successfully hooked module.
LDR: LdrpWalkImportDescriptor() failed to probe e:\tlh1987\vs2008projects\b3dtest\debug\B3DViews.dll 
for its manifest, ntstatus 0xc0150002
First chance exception 0xC0150002 (Unknown) occurred in "NTDLL.DLL" at address 0x7C9873BE.
**Second chance exception 0xC0150002 (Unknown) occurred in "NTDLL.DLL" at address 0x7C9873BE.**
Exited "B3DTEST.EXE" (process 0x680) with code -1072365566 (0xC0150002).

それは私を夢中にさせます。私はそれを理解したくありません。どんな助けでもありがたいです!
これ(http://www.codeguru.com/forum/showthread.php?t=408061)が問題の解決に役立つ場合があります。しかし、私はそれを読んでそれを理解することはできません。私のシステムはwindowsxpsp3で、VS2008を使用しています。VS2005をインストールしませんでした。

4

3 に答える 3

1

なんとなくわかります。このQ&Aの助けを借りて

http://social.msdn.microsoft.com/Forums/nb-NO/vssetup/thread/fa559cb7-eabc-4f41-a3bc-84ed7ae089fc

まず、すべてをアンインストールしましたMicrosoft Visual C++ 2005 Redistributable Package

Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)次に、直接インストールしました。どちらも機能しませんでしたが、インストールすると

Visual C++ 2005 Service Pack 1 再頒布可能パッケージ MFC セキュリティ更新プログラム

それだけで機能します。Update は の古いバージョンをMicrosoft Visual C++ 2005 Redistributable Package削除してから、新しいバージョン (sp1 のもの) を動作させるようです。

于 2011-12-28T07:59:30.797 に答える
1

まず、Microsoft Visual C++ 2005 Redistributable Package をすべてアンインストールし、次に Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) を直接インストールしました。どちらも機能しませんでしたが、インストールすると

Visual C++ 2005 Service Pack 1 再頒布可能パッケージ MFC セキュリティ更新プログラム

それはただ働く

于 2013-06-06T07:02:53.953 に答える
1

0xC0150002LですSTATUS_SXS_CANT_GEN_ACTCTX。アクティベーション コンテキストの問題をデバッグするためのツールは、SxsTrace. これを試して:

touch program.exe
SxsTrace Trace -logfile:SxsTrace.etl
[run program.exe]
SxsTrace Parse -logfile:SxsTrace.etl -outfile:SxsTrace.txt

SxsTrace.txt には、参照されていて見つからないアセンブリの名前が含まれます。

于 2013-12-20T17:54:28.013 に答える