简体   繁体   English

如何动态指定类库DLL的路径?

[英]How to dynamically specify the path to the class library DLL?

Target: dynamically set the path to the class library c#. 目标:动态设置类库c#的路径。 For example, if the path to the DLL is not found. 例如,如果找不到DLL的路径。 Find DLL manually and specify the path where to load. 手动查找DLL并指定加载路径。

You can add a path to the app config that is searched for DLLs. 您可以将路径添加到搜索DLL的应用程序配置中。 Here's an example: 这是一个例子:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="C:\myDLLDirectory\" />
    </assemblyBinding>
  </runtime>
</configuration>

See here for more information and ideas. 有关更多信息和想法,请参见此处。 There are several ways to do it: http://support.microsoft.com/kb/837908 有几种方法可以做到这一点: http : //support.microsoft.com/kb/837908

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM