2016-02-24 52 views
2

我想用我的应用程序从一个更外面的文件夹绑定一个dll文件。与wpf应用程序的c#程序集绑定

例如:

文件结构:

-Important.dll

- 文件夹

  • MyApplication.exe

我需要类似的东西:

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <probing privatePath="../" /> 
    </assemblyBinding> 
    </runtime> 
</configuration> 

但它无法正常工作。

回答

0

我们解决了下列方式:

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
     <runtime> 
       <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
         <dependentAssembly> 
           <assemblyIdentity name="Important" publicKeyToken="1234567890abcdef"/> 
           <codeBase version="1.2.3.4" href="../OtherFolder/Important.dll"/> 
         </dependentAssembly> 
       </assemblyBinding> 
     </runtime> 
</configuration> 
+0

这是行不通的。我需要别的东西吗? – Developer