Could not load file or assembly System.Web.Http, Version=5.2.2.0

后端 未结 8 882
孤街浪徒
孤街浪徒 2020-12-29 22:31

I\'ve just uploaded a Asp.Net Web Api 2.2 project to production server and I got the error stated in the title.

In my Web.config I already have this:



        
相关标签:
8条回答
  • 2020-12-29 23:04

    If you have an assembly in GAC with a different version, it will always be loaded, not the one from bin folder.

    0 讨论(0)
  • 2020-12-29 23:06

    For me, from "Solution Explorer" I checked the ver of "System.Web.Http" in the project references, which was 5.2.3.0 so, in the web.config, I changed:

    <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" /> 
    

    to

    <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.3.0" />
    

    then build. It worked for me!

    0 讨论(0)
提交回复
热议问题