Home > database >  Can not build C# project with Visual Studio 2022
Can not build C# project with Visual Studio 2022

Time:01-23

enter image description here

I don't know what happens with my Visual Studio 2022. When I create a C console project, I can build the project. However, when I do the same thing for C# project, I can not build the project. I look like in the picture. Any help is truly appreciated.

I tried everything I can but it didn't work.

CodePudding user response:

That sounds like a bug. When a new project is created, it should appear in Solution Explorer. However your solution has no projects, and the source file appears in "Miscellaneous Files" (meaning it's not part of a project, and therefore VS won't know how to build it).

Please use the Visual Studio Installer to run a repair on your VS installation. If that doesn't help, use Help | Send feedback | Report a problem and include a recording of the steps you're taking to create a new project. If you link the feedback ticket here, I can make sure it gets looked at by the right people. Thanks.

CodePudding user response:

You need to create a new Console App for creating and running C# projects

Press F5, choose Debug > Start with debugging from the Visual Studio menu, or select the green Start arrow and project name on the Visual Studio toolbar. Or, to run without debugging, press Ctrl F5 or choose Debug > Start without debugging from the Visual Studio menu.

enter image description here

  • Related