Download the .NET SDK from https://dotnet.microsoft.com/en-us/download
When the SDK is installed, use the following command to verify the installation:
dotnet --info
By default, the dotnet
command may work in some locations on your computer. To enable it globally, we will need to add it to your User path.
For Windows
C:\Program Files\dotnet
.You may need to authenticate an HTTPS certification for your .NET SDK so that web browsers will trust your computer as an authentic location for web resources. To do this, run the following command:
dotnet dev-certs https --trust
This may require password authentication or a higher level form of authentication. If this doesn’t work do to permissions, try running the command as an Administrator or SUDO user.
To run a project, navigate to the project root directory (not solution root directory) and run:
dotnet run
Alternatively, if you want to actively develop the app while the program is running, you can use:
dotnet watch
and changes to the program will cause a rebuild automatically.
Download VS Code if you don’t already have it:
Download Visual Studio Code - Mac, Linux, Windows
ms-dotnettools.csharp
tag.Shift + Ctrl/Cmd + P
to open a command pallet within VS Code and type asset to find any missing assets for the project. .NET should show up as an asset and you can click the item to install it.In the same Extensions window, search for C# and find C# Extensions by JosKreativ. This adds a few features, one of which is the ability to right click a folder to create a class template automatically.
In the same Extensions window, search for C# and find NuGet Gallery by pcislo. This is a Microsoft package manager for all .NET extensions.
This is just a preference, but you can change the icons in VS Code to be prettier. Just search for Material Icon Theme by Philipp Kief and install that.
You can minimize the clutter of files on the left by hiding files that you should never edit. To do this, go to File → Preferences → Settings
on Windows or Code → Preferences → Settings
on Mac, type exclude in the search bar, and click Add Pattern.
For .NET projects, add:
**/obj
**/bin
Open the command pallet with Shift + Ctrl/Cmd + P
and type path.
Look for Install 'code' command in PATH and click it. This will add VS Code to your User Path so that you can use code as a command in your shell to open files and directories with VS Code.
Open Settings, type private
in the search bar and change the prefix for “generated private member declarations” to _
. This will add an underscore to the variable names when creating private variables automatically.
Now search for this
in the Settings search field, click C# Extensions under the Extensions section on the sidebar, and uncheck “Whether or not a ctor assignment of a property or variable should be prefixed with this”.