Found conflicts between System.Net.Http

前端 未结 9 1388
一整个雨季
一整个雨季 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:31

    I've had this problem twice now whilst working with Azure Worker roles. Any called to system.net.http simple causes the code to hang, but there is no feedback at all from Azure so it takes hours or days of commenting out code to find the cause let alone a solution.

    A simple trick fixed it for me. This isn't my solution, I came across it about 6 months ago, but when the problem happened to me again today, I thought it worth posting.

    1. Delete any references to System.Net.Http from your project
    2. Go to "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib"
    3. Create a new directory, for example "temphide"
    4. Move all System.Net.* DLL's into this directory
    5. Now when you deploy, your project will use the Nuget version, no more conflicts

提交回复
热议问题