“绑定重定向”在 web.config 中不起作用
我在 web.config 中使用“bindingRedirect”元素来允许更新引用的程序集,而无需重新编译我的网站。但我仍然收到相同的错误:
无法加载文件或程序集“Oracle.DataAccess,Version=2.111.6.20,Culture=neutral,PublicKeyToken=89b483f429c47342”或其依赖项之一。系统找不到指定的文件。
我使用“Oracle.DataAccess”版本2.111.6.20构建了我的网站。之后,我安装了“Oracle.DataAccess”的 2.102.4.0 版本,该版本已安装到 GAC 中。访问网站时,出现上述错误。
我读到可以使用 web.config 中的“bindingRedirect”元素将程序集重定向到较新的版本。我的 web.config 看起来像这样:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="Oracle.DataAccess"
publicKeyToken="89b483f429c47342"
Culture="neutral">
<bindingRedirect
oldVersion="2.111.6.20"
newVersion="2.102.4.0" />
</assemblyIdentity>
</dependentAssembly>
</assemblyBinding>
</runtime>
但即使使用该元素,错误仍然显示!
我尝试改变这条线 到 正如一些论坛中提到的,但它仍然不起作用。
有人知道我的问题的解决方案吗?
I'm using the "bindingRedirect" element in my web.config to allow updates of my referenced assembly without recompiling my website. But I still receive the same error:
Could not load file or assembly 'Oracle.DataAccess, Version=2.111.6.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.
I built my website with version 2.111.6.20 of "Oracle.DataAccess". After that I installed a version 2.102.4.0 of "Oracle.DataAccess" which is installed to the GAC. When accessing the website, the error above is shown.
I read that it's possible to redirect assemblies to newer versions with the "bindingRedirect" element in the web.config. My web.config looks like this:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="Oracle.DataAccess"
publicKeyToken="89b483f429c47342"
Culture="neutral">
<bindingRedirect
oldVersion="2.111.6.20"
newVersion="2.102.4.0" />
</assemblyIdentity>
</dependentAssembly>
</assemblyBinding>
</runtime>
But even with that element, the error is still shown!
I tried to change this line
to
as mentioned in some forums, but it's still not working.
Does anybody know a solution for my problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能有一个发布者策略文件会覆盖您的绑定重定向。通过使用 Fuslogvw.exe 来了解应用了哪些策略。
There might be a publisher policy file that overrides your binding redirect. Find out by using Fuslogvw.exe to see what policies are applied.