作成した実行可能ファイルを実行すると、次のエラーが発生します。
指定されたプログラムを実行できません
私がすぐに考えたのは、VC8.0の再配布可能なDLL(msvcr80d.dll
et al。)の1つとの依存関係の問題であるということでした。プログラムに影響を与えるこれらのDLLのパッチが適用されたバージョンでいくつかの問題が発生しました。
Dependency Walkerで実行可能ファイルを開くと、次のエラーが表示されます。
Error: The Side-by-Side configuration information in "w:\MYPROGRAM.EXE.manifest"
contains errors. This application has failed to start because the
application configuration is incorrect. Reinstalling the application may
fix this problem (14001).
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export
function in a delay-load dependent module.
実行可能ファイルのマニフェストファイルを開くと、次のファイルが含まれています。
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50727.4053' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
Microsoft.VC80.DebugCRT
依存アセンブリのコピーが2つあるようです。
アセンブリの8.0.50727.4053
バージョンがサイドバイサイド構成にありません(このバージョンには、インストールされていないVisual Studioパッチが付属していると思います)。
このアセンブリをマニフェストファイルから削除すると、実行可能ファイルは正常に実行されます。
ただし、アプリケーションを再構築すると、マニフェストが再生成され、追加の依存関係が再度追加されます。
この依存関係がマニフェストに追加される原因は何ですか?別のDLLと関係があると思いますが、私のアプリケーションは、別の再配布可能なDLLのセットを使用して別のPCでビルドする必要がありますが、これを確認したいと思います。
アップデート:
私はこのブログ投稿で多くの提案を試しましたが、幸運はありませんでした。奇妙なことの1つは、リリースビルドを実行したときに生成されるマニフェストに8.0.50727.4053エントリが含まれていないのに、デバッグビルドには含まれていることです。