This is a continuation of our previous articles:
- Getting Started With .NET Core With Windows And Visual Studio 2015 - Part One
- Getting Started With .NET Core With Windows And Visual Studio 2015 - Part Two
- Getting Started With .NET Core With Windows And Visual Studio 2015 - Part Three
Preview
In this article, we will learn how to create a deployment package for .NET Core console applications using the Self-Contained Deployment (SCD) approach.
As we know, we can create two types of deployment package for .NET Core application.
- Framework-Dependant deployment (FDD)
- Self-Contained deployment (SCD).
Let’s understand how to create a deployment of .NET Core application using the Self-Contained Deployment (SCD) approach. We will use the term SCD to represent “Self-Contained Deployment”. As compared to the FDD approach, files created using the SCD approach don't depend on the framework installed on our deployment version.
All the components, .NET Core libraries, and .NET Core runtimes will be included with application deployment files. So, you can expect that a bigger list of files will be created as compared to the FDD approach.
To make things simple, we will use the same application that we have created in our previous articles. So, if you remember, we have created the following two applications using .NET Core Framework.
- DotNetCoreDemo (.NET Core Class Library )
- DotNetCoreApp (.NET Core Console application)
We will publish the “DotNetCoreApp” application using SCD approach.
Step 1 Make changes at project.json file
Now to deploy an application with SCD approach, we need to modify some components of our "project.json" file from “DotNetCoreApp” application.
We need to make the following changes.
- Remove the "type" "platform" from “Microsoft.NETCore.App” section under the “dependencies”.
- Add the runtime section under the project.json. We will specify the platform that our application targets. For demo purposes, we target 32-bit windows 7 platform. So, we will add the following line under the project.json after the framework.
Our final project.json will look like this.- "runtimes" {
- "win7-x86" {}
- }








Join the conversation! Your thoughts help the community grow.