Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何动态指定类库DLL的路径?_C#_Class_Dynamic_Dll_Load - Fatal编程技术网

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

C# 如何动态指定类库DLL的路径?,c#,class,dynamic,dll,load,C#,Class,Dynamic,Dll,Load,目标:动态设置类库c的路径。 例如,如果未找到DLL的路径。 手动查找DLL并指定加载路径。您可以向应用程序配置中添加搜索DLL的路径。下面是一个例子: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="C:\myDLLDirectory\" /> <

目标:动态设置类库c的路径。 例如,如果未找到DLL的路径。
手动查找DLL并指定加载路径。

您可以向应用程序配置中添加搜索DLL的路径。下面是一个例子:

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


您可以向应用程序配置添加搜索DLL的路径。下面是一个例子:

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


您可以使用文件对话框查找dll和要从dll@SonerGönül我还是什么都没做。我写了一个类库,并在项目中引用了它。一切正常。只要DLL位于正确的位置。因此,我要问的问题是,如果在运行时找不到特定于应用程序的DLL,如何指定该DLL的路径。您应该在收到回答问题的答案时单击复选标记。我注意到,在您提出并回答的20个左右的问题中,您都没有这样做。您可以使用FileDialog查找要从dll@SonerGönül我还是什么都没做。我写了一个类库,并在项目中引用了它。一切正常。只要DLL位于正确的位置。因此,我要问的问题是,如果在运行时找不到特定于应用程序的DLL,如何指定该DLL的路径。您应该在收到回答问题的答案时单击复选标记。我注意到,在您提出并回答的20个左右的问题中,您都没有这样做。