DLL文件在web.config中加载的设置位置 [英] Set location of DLLs to load in web.config

查看:1104
本文介绍了DLL文件在web.config中加载的设置位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在web.config中设置特定的DLL的本地文件路径位置加载,而不是在GAC那些DLL或 C:\\ Windows \\ System32下

Is it possible within the web.config to set the local file path location of specific DLLs to load rather than having those DLL in the GAC or C:\Windows\System32.

这将使它更容易部署Web服务,而和这两个具有周围的混乱。

This would make it much easier to deploy the web service, without having to mess around with either of those.

我曾尝试已经到DLL文件添加到项目中,但与出成功。他们是4 Oracle即时客户端dll​​。

I have tried already to add the DLLs to the project but with out success. They are the 4 oracle instant client DLLs.


  • OCI.DLL

  • orannzsbb11.dll

  • oraocci11.dll

  • oraociicus11.dll

如果任何人这样做的方式,将是巨大的知道了。

If anyone knows of a way of doing this that would be great.

编辑:
请注意,记下的DLL是强命名这样我就可以使用他们的公共密钥不引用它们。

Please note, note of the DLLs are "strongly named" so I cannot reference them using their public key.

另外,它们不是直接在目前,因为它们不添加项目引用

Also, they are not referenced directly in the project currently because they fail to add.

推荐答案

您可以使用的 dependentAssembly 元素来指定一个 DLL 家住通过 codeBase类元素。

You can use the dependentAssembly element to specify where a dll lives through the codeBase element.

不过,我相信这需要一个有效的URL。

However, I believe this needs to be a valid URL.

例如,从 MSDN

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="myAssembly"
                              publicKeyToken="32ab4ba45e0a69a1"
                              culture="neutral" />
            <bindingRedirect oldVersion="1.0.0.0"
                             newVersion="2.0.0.0"/>
            <codeBase version="2.0.0.0"
                      href="http://www.litwareinc.com/myAssembly.dll"/>
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>

这篇关于DLL文件在web.config中加载的设置位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆