C
C#2y ago
anka_a

Basic Visual Studio Debugging

Hi, I am having problems with the debugging process, It wants me to attach the program before starting it, I am very beginner and have no clue how to attach, I a using VS 2022
33 Replies
Angius
Angius2y ago
$debug
MODiX
MODiX2y ago
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
Angius
Angius2y ago
If you're running your project through VS, you should not need to attach anything
anka_a
anka_a2y ago
Angius
Angius2y ago
Did you just open a loose Program.cs file?
anka_a
anka_a2y ago
anka_a
anka_a2y ago
what do you mean by loose?
Angius
Angius2y ago
Not a .csproj project or a .sln solution
anka_a
anka_a2y ago
it was sln
Angius
Angius2y ago
VS will open C# files on their own, sure Aight, that's odd, then Do you see the solution explorer?
anka_a
anka_a2y ago
I don't
anka_a
anka_a2y ago
Angius
Angius2y ago
No solution explorer on the right of the screen in VS?
anka_a
anka_a2y ago
there is
anka_a
anka_a2y ago
Angius
Angius2y ago
Empty, though
anka_a
anka_a2y ago
yes
Angius
Angius2y ago
It seems you didn't add a project to the solution, somehow
anka_a
anka_a2y ago
Is that even possible
Angius
Angius2y ago
Apparently ¯\_(ツ)_/¯ Right-click on the solution and try to add an existing project Then add your project
anka_a
anka_a2y ago
right clck, then add
anka_a
anka_a2y ago
anka_a
anka_a2y ago
anka_a
anka_a2y ago
still empty
anka_a
anka_a2y ago
.-.
Angius
Angius2y ago
Existing project, not a new project
anka_a
anka_a2y ago
anka_a
anka_a2y ago
it gives me an error
Angius
Angius2y ago
huh So... do you, by chance, not have the SDK installed... somehow? dotnet --list-sdks in the console
anka_a
anka_a2y ago
I have no clue I am downloading it I managed it I guess...
anka_a
anka_a2y ago
is that what it should look like?
Angius
Angius2y ago
ye
anka_a
anka_a2y ago
Thanks then