Running Visual Studio (Windows) Projects on VS Code (Windows/Mac)
I mostly use Visual Studio (Windows) while working on .NET. However, occasionally, I am forced to use VS Code to run these projects. Here are some quick simple steps.
As I focus only on the beginner steps, these steps will work for projects that are simple, like the ones you can find at my github repo.
https://github.com/Jay-study-nildana/CSharpForStudents
Another thing to note is the Mac situation. There are differences between how Mac and Windows operate, especially with respect to paths. So, if you have path specific things, those things will need additional changes before you can run them on Mac.
Of course, if you are simply switching from Visual Studio (Windows) to VS Code (Windows), you won’t face these issues as the path situation is the same.
But, yes, you may not face this issue at all because very few projects have paths, especially absolute paths that are OS specific.
First step, after you have installed VS Code, get the following essential extensions.
https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscode-dotnet-runtime
https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp
https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit
Make sure you have enabled notifications (or at least, don’t disable the notifications when they pop up).
Now, simply open your Visual Studio (Windows) project folder, in your VS Code. It might look something like this.
Now, notice how I have opened ‘Program.cs’. Make sure that file is open. This is critical.
Now, at the top menu, you have to go for, Run > Start Debugging.
Now, you might get some kind of error while the extensions you have installed before do their work. This will take a few seconds. Just wait for about 10 to 20 seconds.
Now, go back and try, Run > Start Debugging. This time, just like Visual Studio (Windows), the browser or console window (terminal in VS code) should pop up. And, that’s it.
Before I wrap up here, I still find it weird, coding in VS Code. I grew up on Visual Studio (Windows) and I am used to it. However, today’s generation developer, which is you, my dear student, are starting off with a fresh mind. So, you might feel that VS Code is better than Visual Studio (Windows).
Live and Let Live, eh?
this is a copy of my own post from my blog at medium