开发者

"bindingRedirect" in web.config does not work

开发者 https://www.devze.com 2023-01-16 14:34 出处:网络
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:

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:s开发者_JS百科chemas-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?


There might be a publisher policy file that overrides your binding redirect. Find out by using Fuslogvw.exe to see what policies are applied.

0

精彩评论

暂无评论...
验证码 换一张
取 消