How do I fix "HRESULT: 0x80070002" error when creating a new Visual Studio 2022 project?

Steven Buechele 0 Reputation points
2023-08-12T17:43:12.9366667+00:00

I'm trying to create a new c++ project in Visual Studio 2022 IDE, but I can't create any kind of project. I receive the error, "The system cannot find the file specified. (Exception from HRESULT: 0x80070002)"

I'm creating a new project in a folder that does exist. Shouldn't it create the file when I tell it to start a new project? Why is this error occurring, and how do I fix it?

Developer technologies | Visual Studio | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2023-08-14T03:29:59.02+00:00

    Hi @Steven Buechele

    Welcome to Microsoft Q&A! 

    Please open the Visual Studio Installer > Modify > Workloads tab > ensure that the Desktop development with C++ workload is installed.

    Could you successfully run your Visual Studio 2022 in Safe Mode (run devenv /SafeMode in Developer Command Prompt for VS 2022)? 

    If your VS2022 works fine in safe mode, it may be caused by the installed extensions.

    Please disable or uninstall the installed extensions under Extensions > Manage Extensions > Installed

    Then, restart your VS2022 and create project again. 

    Besides, you can try to repair your VS2022 via Visual Studio Installer > More > Repair

    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.

    0 comments No comments

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.