ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,417 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hello
I am developing asp.net web using .net framework 4.6.1 but i stuck in a warning:
Severity Code Description Project File Line Suppression State
Warning Found conflicts between different versions of "System.Net.Http" that could not be resolved.
There was a conflict between "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
"System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
References which depend on "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.Net.Http.dll].
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.Net.Http.dll
Project file item includes which caused reference "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.Net.Http.dll".
System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
References which depend on "System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\System.Net.Http.dll].
C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\xxx.Web.Service.dll
Project file item includes which caused reference "C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\xxx.Web.Service.dll".
C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\xxx.Web.Service.dll
C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\System.Web.Http.dll
Project file item includes which caused reference "C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\System.Web.Http.dll".
C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\xxx.Web.Service.dll
C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\Microsoft.Identity.Client.dll
Project file item includes which caused reference "C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\Microsoft.Identity.Client.dll".
C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\xxx.Web.Service.dll
C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\System.Web.Http.WebHost.dll
Project file item includes which caused reference "C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\System.Web.Http.WebHost.dll".
C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\xxx.Web.Service.dll
C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\System.Net.Http.Formatting.dll
Project file item includes which caused reference "C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\System.Net.Http.Formatting.dll".
C:\ave\acsdev3\xxx\appService\xxx.Web.Service\bin\xxx.Web.Service.dll xxx.Web.Service 0
I search a lot and find a lot of people meets this issue. can some one give me a working solution? thanks
Hi @kong ,
Make all references and binding redirects use 4.2.0.0 like this,you could try:
<Reference Include="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
...
</Reference>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
Best regards,
Yijing Sun
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.