Visual C++ 9.0 SP1のランタイム問題
問題と言うほどでもないのだけれども、VC++9.0SP1でプログラムをリンク(/MD)すると、次のようなmanifest(これは64-bit版)が埋め込まれる。
<?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.CRT' version='9.0.21022.8' processorArchitecture='amd64' publicKeyToken='1fc8b3b9a1e18e3b' /> </dependentAssembly> </dependency> </assembly>
注目すべきは、CRTのバージョンで、ここでは、9.0.21022.8となっている。しかしながら、9.0.21022.8というのは実は、VC++9.0無印のバージョンであるのが問題。SP1ならば、本当は、9.0.30729.1でなければならない。簡単に言えば、せっかくのSP1が適用されていない状態。
なのに、%ProgramFiles%\Microsoft Visual Studio 9.0\VC\redist に存在するredistのDLLは、9.0.30729.1だったりする。どうやら、既にConnectにも報告されている(361682: VC9 SP1 generates manifests with the wrong version number)けど、ちょっと最近のVisual Studioのredistがらみのミスは致命的なのが多い気がする。