私には、しばらくの間頭を悩ませている問題があります。私がリリースした WPF/.NET 3.5 製品では、次のエラーが原因で、100 回のインストールのうち約 1 回でソフトウェアをまったく実行できません。
System.Windows.Markup.XamlParseException: オブジェクトの初期化に失敗しました (ISupportInitialize.EndInit)。見つかったアセンブリのマニフェスト定義がアセンブリ参照と一致しません。(HRESULT からの例外: 0x80131040) マークアップ ファイル 'mainwindow.xaml' のオブジェクト 'System.Windows.Controls.MenuItem' でエラーが発生しました。
これは、次の 3 つの理由で不可解です。
これは、インストールの約 1 ~ 2% でのみ発生します。
これらのシステムの .NET インストールまたは OS について、私が知る限り、何も異常はありません。
これは、既定のフレームワーク参照 (System.Windows.Controls.MenuItem) で発生しています。
誰でもこれの考えられる原因を考えることができますか?
編集:「500」のヒントに従った後、顧客のマシンで Fusion ログ ビューアーを実行できました。開発マシンと他のすべてのテスト マシンでは、"PresentationFramework" と "PresentationFramework.Aero" に対するバインディングの試みが成功しています。クライアント マシンでは、失敗する追加のバインド試行があります (無関係な行が削除されています)。
*** Assembly Binder Log Entry (2/3/2013 @ 1:18:44 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = PresentationFramework.Dawn TOP, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: PresentationFramework.Dawn TOP, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/My App/PresentationFramework.Dawn TOP.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/My App/PresentationFramework.Dawn TOP/PresentationFramework.Dawn TOP.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/My App/PresentationFramework.Dawn TOP.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/My App/PresentationFramework.Dawn TOP/PresentationFramework.Dawn TOP.EXE.
LOG: All probing URLs attempted and failed.
「PresentationFramework.Dawn」を Google で検索しても結果が返されず、このファイルへの参照が見つかりません。実行できる説明または追加のテストはありますか?
編集 2: お客様が「Dusk」と呼ばれる非公式の Windows 7 Aero テーマをインストールしていたことが判明しました。何らかの理由で、PresentationFramework は、PresentationFramework.Aero ではなく、PresentationFramework.Dusk を呼び出すことにしました (プロジェクトに明示的に含めた参照)。DuskがGACで見つからないため、エラーはサードパーティのテーマの不適切なインストールの結果であると想定していますが、参照の試行を停止し、すべてのGUI要素を強制する方法について何か光を当てることができますか? PresentationFramework.Aero を使用しますか?