VS 2022 can't start because it can't find files : System.Net.Http,

huhu123 0 Reputation points
2024-10-03T19:11:43.8766667+00:00

Hello, I can't launch VS 2022 because of an error :
"Impossible to start Visual studio because of an error. System.IO.FileNotFoundException : Impossible to load the file or the assembly ‘System.Net.Http, Version = 4.0.0.0, Culture = neutral, PublicKeyToken=b03f6f7f11d50a3a’ or one of the dependencies. The file specified is unfindable. InnerException - System.IO.FileNotFoundException: Impossible to load the file or the assembly ‘System.Net.Http,Version=4.2.0.0, Culture=neutral, PublicKeyToken = B03f5f7f11d50a3a’ or one of the dependencies. The file specified is unfindable."

I already tried uninstalling, reinstalling, reparing, launching in administrator mode, "devenv /SafeMode", renaming "System.Net.Http.Formating.dll" does not work.
The only thing that worked is "devenv /ResetSettings" but VS close automatically after 5s, (but buttons works).
"System.Net.Http.Formating.dll" in Depency walker gives a lot of errors :
Error: At least one required implicit or forwarded dependency was not found.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

(There is a lot of files missing)

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,187 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 31,166 Reputation points Microsoft Vendor
    2024-10-04T09:37:22.3933333+00:00

    Hello @huhu123,

    Welcome to Microsoft Q&A forum.

    Please try following:

    1. Rename this folder(ComponentModelCache) to ComponentModelCache_backup: C:\Users\username\AppData\Local\Microsoft\VisualStudio\17.0_xxxxxxxx\ComponentModelCache, run the devenv /ResetSettings command again, start VS, see if the error disappears.
    2. Update Windows OS, and make sure that all patches have been installed.
    3. Run CMD as admin, run DISM.exe /Online /Cleanup-image /Restorehealth and sfc /scannow commands.
    4. Reboot your machine, rename %temp% folder and %localappdata%\Microsoft\VisualStudio folder then relaunch VS.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.