Code Analysis error Could not load file or assembly 'System.Net.Http, Version=2.0.0.0 in MVC4 Web API

前端 未结 4 818
醉话见心
醉话见心 2020-12-13 06:42

this problem is exactly the same as this post http://forums.asp.net/t/1807797.aspx/1?System+Net+Http+is+not+found and this one on StackOverflow

I have all the latest

4条回答
  •  长情又很酷
    2020-12-13 07:09

    The issue is caused because you have a dependency on a newer version of System.Net.Http, than that required by one of the other assemblies referenced.

    The correct way to resolve this issue is to add dependentAssembly redirects to the app.config of offending projects. The accepted answer of disabling the errors just masks an underlying problem.

    Add the following to the runtime section of app.config to remap the old version that can't be resolved to the version referenced in your project. The version numbers should obviously be updated to correspond to your situation.

    
      
        
          
          
        
      
    
    

提交回复
热议问题