为了程序结构清晰,往往会将DLL按照一定规则放在不同的目录下,而不是默认的统统放在bin目录,但这会造成运行时找不到对应程序集,如何解决该问题呢?
.NET可以通过应用程序配置文件指定运行时要匹配的路径,在web.config的configuration节添加如下配置即可:
        <runtime>  
              <assemblyBinding   xmlns="urn:schemas-microsoft-com:asm.v1">  
                    <probing   privatePath="bin\subbin1;bin\subbin2"/> 
              </assemblyBinding>  
        </runtime>  



同样,WinForm应用程序可在app.config中设置。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2021-09-19
  • 2021-08-27
  • 2022-12-23
  • 2021-08-02
猜你喜欢
  • 2022-12-23
  • 2021-08-24
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
相关资源
相似解决方案