在exe根目录外使用dll,很简单只需要配置app.config文件即可。
在runtime中写上调用dll的目录即可!就是这么简单。这样程序或从指定目录寻找引入的dll!
<?xml version="1.0"?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku = ".NETFramework,Version=v4.0"/> <supportedRuntime version="v2.0.50727"/> </startup> <runtime> <gcConcurrent enabled="true" /> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <publisherPolicy apply="yes" /> <probing privatePath="Web" /> </assemblyBinding> </runtime> <runtime> <gcConcurrent enabled="true" /> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <publisherPolicy apply="yes" /> <probing privatePath="DLL" /> </assemblyBinding> </runtime> </configuration>
关键字词: