"Attach to process" is for remote debugging. Simply hit the green "Play" button or key "F5".
Attach to process In Visual Studio 2022
I just recently started VS coding in C# with Project type: ConsoleApp
I use.NET 8.0, or whatever it's called because it's the newest version. I created my first project and wrote the basic "Console.WriteLine("Hello World");"
I try to run the project by clicking "attach..." as I don't see any other option to run, and it tells me to attach to the process. I know this is not a bug, but it's frustrating because I spent hours on it trying to figure out why it's not bringing up the console. Please help me with this..
3 answers
Sort by: Most helpful
-
-
Vortex Studios 0 Reputation points
2024-02-24T23:51:32.1833333+00:00 I got the issue. If any of you are facing this issue, just don't use the "Console app"; instead, use the "Console App (.NET Framework)." It does the same thing, except you have to write some fancy code at the top.
-
Tianyu Sun-MSFT 30,566 Reputation points Microsoft Vendor
2024-02-26T07:39:20.47+00:00 Hello @Vortex Studios ,
I am happy to hear that you can currently switch to use .NET Framework based project to continue developing. But as @David Lowndes mentioned, a .NET 8 console application should also work.
I think there’s something wrong with the installed .NET on your side. You can try to download and install .NET 8 manually and separately from here: Download .NET 8.0, this may fix the issue.
Also as I mentioned above, you may need to confirm that
C:\Program Files\dotnet\
is listed higher thanC:\Program Files (x86)\dotnet\
(environment variables).It’s also possible that VS doesn’t install correctly, you can try a repair(VS Installer, More, Repair) or a reinstall if necessary.
Best Regards,
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.