Start a new project in VSCode
VSCode works primarily with folders.
If it discovers a .sln, project.json or global.json file in the folder you open, it will load them and allow you to switch between them.
The explorer will always show the filesystem, regardless of what project is currently loaded.
Also, on startup, VSCode will automatically open the last opened folder.
- File->New Window seems to do the trick
- The projects are filesystem based. So if it's in your folder structure it'll be shown in VSCode; I believe this is by design. The only way to remove the folder would be to do so from the FS level.
Pressing shortcut
Ctrl + Shift + N
opens a new Window, which gives you the possibility to open a new folder.
On macOS it's
Cmd + Shift + N
- Create a new Folder
- Use VS Code to Open that empty folder.
- Open the Integrated Terminal by selecting View\Terminal
- In the terminal window, type
dotnet new console
.
This command creates a Program.cs
file in your folder with a simple "Hello World" program already written, along with a C# project file named HelloWorld.csproj