次のクライアント アプリケーションとそれに対応するconfig
ファイルがあります。
namespace Chapter9
{
class Program
{
static void Main(string[] args)
{
AppDomain.CurrentDomain.ExecuteAssembly("AssemblyPrivate.exe");
}
}
}
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<codeBase href="file://C:\Users\djpiter\Documents\Visual Studio 2008\Projects\70536\AssemblyPrivate\bin\Debug\AssemblyPrivate.exe"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
にはAssemblyPrivate.exe
公開鍵がなく、GAC にもありません。私の知る限り、ランタイムはapp.config
クライアント アプリ ディレクトリでアセンブリを探す前にファイルを解析する必要があります。
未処理の例外 (読みやすいようにラップされています) は次のとおりです。
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly
'file:///C:\Users\djpiter\Documents\Visual Studio 2008\Projects\70536\Chapter9\bin\Debug\AssemblyPrivate.exe'
or one of its dependencies. The system cannot find the file specified.
なぜ機能しないのですか?(静的ではなく) 動的バインディングを使用する必要があります。
敬具、PK