Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT)) in Visual Studio 2022

An Thuyen 0 Reputation points
2024-06-10T03:18:38.8766667+00:00

I want to create new solution in visual studio 2022(any template) but then i face an error:

Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT)). But i can still open exist project.

I tried:

  1. Uninstall and install visual studio but face same error
  2. Change the path in variables to:

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe

  1. Repair in visual studio in installers.

But nothing can solve my problem. How can i solve it?

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

3 answers

Sort by: Most helpful
  1. Anna Xiu-MSFT 27,891 Reputation points Microsoft Vendor
    2024-06-10T08:14:45.26+00:00

    Hi @An Thuyen, 

    Welcome to Microsoft Q&A! 

    Does your VS work before? Could you tell us how you change the path in variables?

    To confirm it again, please search "Edit the system environment variables" in Windows Search box > Open it > Environment Variables… > ensure you select System variables not User variables > select Path > Edit….

    Besides, please check your System environment variables if there is the following path to dotnet:

    C:\Program Files\dotnet 

    You can try to launch your Visual Studio 2022 in Safe Mode (run devenv /SafeMode in Developer Command Prompt for VS 2022) and check that the project is created properly. 

    Sincerely,

    Anna


    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.

     


  2. Michael Taylor 51,346 Reputation points
    2024-06-10T15:26:04.75+00:00

    You added msbuild.exe, a program, to your path. That is always the wrong answer. The path variable is for paths, not files. Irrelevant you shouldn't be adding a path to msbuild in any case as it'll mess things up. Remove that msbuild reference from your path and reboot.

    After you've rebooted then start VS and try to create a project. To narrow down the issue try to create the following items, one by one.

    • Blank solution
    • Windows Forms (NET Framework)
    • Windows Forms App - the NET Core version
    • ASP.NET Core Web App

  3. An Thuyen 0 Reputation points
    2024-06-10T16:43:19.78+00:00

    After change the path to:

    C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\BinUser's image

    And reboot then start visual i still can not create new solution. What should i do now?

    Thanks for your help!