none
Problem of System.Net.Http of .Net Framework 4.8 RRS feed

  • Question

  • I'm transferring my program from .Net Framework 4.7 to 4.8, and use a method to detect if there're dll version conflicts between different C# projects - and face this problem.

    Below projects are all base on .Net Framework 4.8.

    For the system.net.http, it shows reference version as 4.2.0.0 in visual studio project > reference > properties. It refers to "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Net.Http.dll".

    But when I start with debug, and check it using visual studio "module", it shows the dll is loaded as 4.0.0.0. It refers to "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll". 

    I'm questioning that why does the reference version differ from the runtime version? 

    And how can I make the two versions consistent based on .Net Framework 4.8? 

    I installed .NetFramework 4.8 SDK on my machine and try to uninstall and reinstall several times, yet cannot solve my problem. 

    Any clue or suggestion?

    Tuesday, February 11, 2020 2:31 AM

All replies

  • Please refer to this documentation on how .NET runtime determine which library to load.

    If you do not specify exact strong name signature in the <EXE filename>.config file(step 1), and obviously step 2 does not apply because your EXE just started, it'll try to load from GAC (step 3), then DLLs within "codeBase path" or "application folder" in specific path pattern (step 4).

    Tuesday, February 11, 2020 8:26 AM
    Answerer
  • Thank you for reply. Yet, how could I locate the "System.Net.Http" runtime version to 4.2.0.0 from GAC?

    I've installed .NetFramework 4.8, however, in the system folder "C:\Windows\Microsoft.NET\Framework64", I could just find the dll with 4.0.0.0.

    Also, if I try to find the single assembly from nuget, the highest version supported is 4.3.2, which is 4.1.1.1 as its AssemblyVersion([assembly: AssemblyVersion("4.1.1.1")]).

    I'm confused about this dll as it's along with .Net Framework. Otherwise this document could solve my problem.

    • Edited by Ellen SH Wednesday, February 12, 2020 1:49 AM
    Wednesday, February 12, 2020 1:38 AM
  • Are you sure the version number is really 4.0.0.0?

    Since .NET v4.X versions are "in-place update", as soon as you installed .NET v4.8, it should have overwritten the DLL in "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a" folder.

    You're advised to open that folder, then right click the file -> "Properties" -> "Detail" tab, and see the actual version number of DLL. (Say, in my current system which is Win7, it says "4.7.3163.0" for file version)

    If it's indeed an older version you may want to reinstall you're .NET framework runtime for v4.8 because it indicates the installation has problem.

    Wednesday, February 12, 2020 3:55 AM
    Answerer
  • Hi Ellen SH,

    How’s it going? Do you have any updates about the issue? Please reply to let us know if this issue has been resolved. If so, I can mark this thread as answer.

    Best Regards,

    Xingyu Zhao



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 13, 2020 9:54 AM
    Moderator