我有以下客户端应用程序及其相应的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