このアプリケーションは、それぞれが独自のサブディレクトリにあるプライベート アセンブリのセットを動的に読み込みます。それらはそれぞれ、同じサブディレクトリにもある独自の依存関係を持っています。各アセンブリには厳密な名前が付けられ、依存関係は同じライブラリですが、バージョンが異なります。
MyApp
|-> Folder1\
| |->PrivateAssembly1.dll
| |->Dependency.dll Version 1.0.0.0
|
|-> Folder2\
| |->PrivateAssembly2.dll
| |->Dependency.dll Version 2.0.0.0
|
...
xcopy 展開を行っているため、GAC は使用しません。
また、プライベート アセンブリが見つからないという問題を解決するために をprobing privatePath
定義しました。"Folder1;Folder2"
問題は、PrivateAssembly1.dll はその依存関係を見つけているように見えますが、PrivateAssembly2.dll は見つけていないことです。というか、Folder2 の代わりに Folder1 の Dependency.dll を使用しようとしているようです。
AssemblyResolve イベントを使用してこれらの問題を手動で解決できることはわかっていますが、これは最もクリーンな方法ではありません。私が見落としている他の解決策はありますか?
ありとあらゆるアイデアをありがとう。
アップデート:
Fusion Log ツールの出力:
LOG: DisplayName = Dependency, Version=1.0.0.0, Culture=neutral, PublicKeyToken=#########
(Fully-specified)
LOG: Appbase = file:///C:/Workspaces/Shell/MyApp/bin/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
...
LOG: Attempting download of new URL file:///C:/Workspaces/Shell/MyApp/bin/Dependency.DLL.
LOG: Attempting download of new URL file:///C:/Workspaces/Shell/MyApp/bin/Dependency/Dependency.DLL.
LOG: Attempting download of new URL file:///C:/Workspaces/Shell/MyApp/bin/Folder2/Dependency.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Workspaces\Shell\MyApp\bin\Folder2\Dependency.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Dependency, Version=2.0.0.0, Culture=neutral, PublicKeyToken=#######
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
したがって、基本的には、Folder2 で Dependency.dll を見つけ、バージョンが一致しないことを確認するためだけにそれをロードしようとします。次にFolder1を試すと思いますが、そこで止まります...