====== .NET Core in Linux ====== ===== Installation of .NET Core ===== These instructions are for .NET Core v1.0.4 in Linux Mint 18. Instructions for other versions and other distros are very similar. Please visit https://www.microsoft.com/net/core for more information. Add the apt-get feed for Linux Mint 18: sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list' sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893 sudo apt-get update Install the .NET Core SDK: sudo apt-get install dotnet-dev-1.0.4 If you'd like to install a different version, ensure that you're installing the latest version, or just check to see what's available, you can search with apt-cache: apt-cache search dotnet Create a test app: dotnet new console -o testinstallation cd testinstallation Restore the app's required packages, and run it: dotnet restore dotnet run When you see "**Hello, World!**" as your output, you've verified your installation, and .NET Core is ready to go! ===== Visual Studio Code ===== There's no "Visual Studio IDE Community Edition" for Linux //yet//, but Microsoft has created a very capable cross-platform programmer's editor called Visual Studio Code. It includes many of the handy features and behaviors you've grown used to in the Visual Studio IDE. - Go to https://www.visualstudio.com/ - Click the Visual Studio Code download button. - Click the .deb button. - After the download completes, click the .deb file. It will launch Package Installer automatically. - Click the "Install Package" button. After the installation completes, locate Visual Studio Code in your menu and launch it. Before you start working on any projects, you'll need to install the C# extension: - Locate the Extensions button in the sidebar and click it. - In the search box, type **C#**. It will probably be the first match. Verify by looking for the description "C# for Visual Studio Code (powered by OmniSharp)". - Click the Install button. - After the install completes, you'll be prompted with a Reload button. Go ahead and click it. The extension will be activated. Visual Studio Code has a very active extension community. I recommend searching the extension marketplace. You'll find lots of useful items. One example: You'll probably want to install the "C# Extensions" extension, by jchannon. It simplifies the creation of C# classes and interfaces. Now you're ready to create some projects! ===== .NET Core Project Examples ===== The .NET Core CLI provides several project templates. This command: dotnet new ...will show you a list, something like this: Templates Short Name Language Tags ---------------------------------------------------------------------- Console Application console [C#], F# Common/Console Class library classlib [C#], F# Common/Library Unit Test Project mstest [C#], F# Test/MSTest xUnit Test Project xunit [C#], F# Test/xUnit ASP.NET Core Empty web [C#] Web/Empty ASP.NET Core Web App mvc [C#], F# Web/MVC ASP.NET Core Web API webapi [C#] Web/WebAPI Solution File sln Solution The calling convention to create a project is as follows: dotnet new