Skip to content

.NET Core project templates

New plugin for Visual Studio 2015 – Microsoft ASP.NET and Web Tools (download here) provides new templates for .NET Core – Console Application and Class Library. These templates are the base structure for all multi-platform projects in .NET.

.NET Core templates

Let’s start with executable type – Console Application. By default this one contains three files – AssemblyInfo.cs, Program.cs and project.json. Program file provides an entry point for application – just like normal static Main method in .NET Framework. The last one, project.json file is more interesting – it is the successor for old app.config. In this file you can find dependencies, .NET Core frameworks and nuspec information.


What’s the difference between library project? It is this same file, except for one property:

"compilationOptions": { 
        "emitEntryPoint": true
},

emitEntryPoints marks whole project as an executable console application.

What about unit tests project? Well… In this version of Web Tools there is no default project for tests, but its not a problem – libraries works correctly with xUnit and NUnit.

Each project in solution shares one file – global.json. It is a simple json with two properties – entry path for files and version of .NET Core SDK.

If you like live demo, visit my github page. My Kronos project has two libraries, one console app (server deamon) and tests project for each of them.