Found conflicts between System.Net.Http

前端 未结 9 1414
一整个雨季
一整个雨季 2020-12-08 07:12

I have several projects in my VS solution. Whenever I add \"System.Net.Http\" NuGet package to one it shows as version 4.2.0.0. Then I do the same and add same NuGet Package

9条回答
  •  情歌与酒
    2020-12-08 07:29

    The 6 steps that Neo posted above helped me solve my ASP.NET package problems! Thank you Neo! I was dealing with this for over a week.

    I just want to share my personal notes from my experience of implementing Neo's post above.

    I had an ASP.NET Web API project that targeted .Net Framework 4.6.1

    Here is what I did:

    • Upgrade to .Net Framework 4.7.2
    • Update all NuGet packages to the latest.
    • (optionally, could also do "update-package -reinstall" to make sure all packages are associated with 4.7.2)
    • Consolidate packages
    • I did not migrate from packages.config to PackageRefence, because you can't in ASP.NET
    • Removed references from System.Net.Http and others that required it, and added them as NuGet packages.
    • Removed all assembly bindings from web.config and app.config (in .Core, .Tests, .IntegrationTests libraries)
    • Added binding redirects for our in-house NuGet packages that had version numbers that ended with text (n.n.n.n-beta), but removed text and had numbers only (n.n.n.n)
    • Added this to all .csproj files:
      • MSBuild and
      • https://github.com/Azure/azure-webjobs-sdk/issues/1598
    
      true
    
    
    • Make sure the packages in all packages.config files have the same versions in all projects in the solution
      • Make sure the versions are the same in the web.config
      • Make sure the versions are the same in the .csproj file, if applicable
    • Use Microsoft.Net.Compilers 3.1.1 (update all .csproj files in solution, including .Tests and .IntegrationTests)
    • For Data Protection API (DPAPI) that use Redis:
      • Install Microsoft.AspNetCore.DataProtection.StackExchangeRedis 2.2.5
      • StackExchange.Redis 2.0.601
      • Update System.Numerics.Vectors to 4.4.0 (note: 4.5.0 has a bug in it that prevents server connection)

提交回复
热议问题