How do I make a C# Console app build and debug in Visual Studio Code?

0 Answers 19 Views
General Discussions Window
William
Top achievements
Rank 1
William asked on 30 Jan 2025, 02:28 PM
This is on a Windows 10 OS Version 22HG2 (OS Build 19045.5371)

How do I make a C# Console app build and debug in Visual Studio Code?   

I have already built my C# Console App in Visual Studio Code.  The issue I have is when I reopen the folder where the project file is in Visual Studio Code and then rebuilding the code and debugging it again.    

Here is what I do and what happens.  After I open the folder where the project file resides,  I click on this to process the code to debug: 

https://likablelogic.org/images/lost/07.png

And then I click on the appearing "Run and Debug" button

https://likablelogic.org/images/lost/08.png

But then the bottom status bar says "Looking for CSS classes in the workspace..." followed by a percentage in paragraphs.  Why is this?  Why does this happen when there are no CSS classes at all and my project is a C# project?   

https://likablelogic.org/images/lost/09.png

Why is this?  This is just a brief snapshot of some difficulties I find when I reopen a project after I have closed Visual Studio Code.  I have experienced other errors and problems in building and running my code.   

To continue, in order to deal with the project as a solution, I click on this icon to open the solution panel. 

https://likablelogic.org/images/lost/10.png

This seemingly allows me to view the solution.  As the following view appears, I click on the project.cs file and attempt a debugging session from there. 

https://likablelogic.org/images/lost/11...png

With this file being displayed, I clicked on the menu option, Run -> Start Debugging   

https://likablelogic.org/images/lost/12...png

Then, at this point, in the pop up option window that appears in the middle and top of the development environment, I pick "C#":  

https://likablelogic.org/images/lost/13...png

Something went wrong and in the bottom right of my IDE, I get this message:   

https://likablelogic.org/images/lost/14.png

Please advise.  What should I do now?      

There are some websites where I can spend time following steps to set up a proper development environment. Before I spend time doing this, I think I will spend time looking at the a few short tutorials Youtube on this topic. The one I seemed to be the best had a step at the beginning of the tutorial where he typed 'dotnet run' in the terminal window of the IDE. I tried that and I got some wierd results on my project that I thought I would mention here.

First of all, in the status bar at the bottom, it mentioned CSS loading, for some reason, but also a notice that the IDE was initialising MSBuild project tools.
https://likablelogic.org/images/lost/css.png
https://likablelogic.org/images/lost/msbuild.png
Then, once that was over, I got this error message:
https://likablelogic.org/images/lost/git.png
Please advise. What should I do now?

No answers yet. Maybe you can help?

Tags
General Discussions Window
Asked by
William
Top achievements
Rank 1
Share this question
or