Click here to Skip to main content
15,867,308 members
Articles / All Topics

ASP.NET Core: Upgrading ASP.NET Core 1.0 RC2 Project to RTM

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
5 Jul 2016CPOL4 min read 14.6K   1   6
ASP.NET Core: Upgrading ASP.NET Core 1.0 RC2 Project to RTM

A month ago, I demonstrated how to migrate your ASP.NET 5 beta project to Core RC2. The migration from Beta to RC2 was a bit long but pretty much easy to follow, and I was able to run my prototype apps smoothly without any hiccups. Recently, ASP.NET Core RTM was out. Microsoft announced the release of ASP.NET Core 1.0 couple of days ago. Big thanks to Microsoft and to the .NET Core team for their utmost effort on making this final release. Kudus!

Let’s Get Cracking!

In this article, we’re going to look at how to upgrade our existing ASP.NET Core RC2 App to RTM in Windows environment using Visual Studio 2015.

Installation Requirements

Installing Visual Studio 2015 Update 3

Note: You may need to uninstall the RC2 bits (Update 2) before installing the RTM bits (Update 3).

You may need to close all instances of Visual Studio that are running on your machine before installing Visual Studio Update 3 (vs2015.3). Now if you are getting the following setup warning below:

Figure 1: Setup Warning

Don’t panic. Just click Continue and it should bring you to the next step below:

Figure 2: Features

Select the features that you would like to be included for this update and then click “Next”. Verify all the features you need in the next step and then click “Update” to start applying the changes.

You may need to wait for a few minutes or a few hours depending on your connection before it completes the upgrade. Once completed, you should be able to see the following figure below:

Figure 3: Setup Completed

After the installation, make sure to restart your machine to ensure updates will take effect.

Installing .NET Core 1.0.0 VS Tooling Preview 2

Now install the Tooling Preview 2 that you have just downloaded. You should see something like this as the installation progress:

Figure 4: VS 2015 Tooling Preview 2 installation

Once the installation is complete, then you should be able to see something like this:

Figure 5: VS 2015 Tooling Preview 2 installation completed

Upgrading to RTM

In this demo, I’m going to use the ASP.NET Core MVC project that I’ve demonstrated before. Now let’s start modifying.

Note: You may need to run Visual Studio as administrator to make sure that restoring of NuGet packages will run smoothly.

project.json changes

The fastest trick to upgrade is to create new project and compare your existing “project.json” file with the new project.

Looking at the newly created ASP.NET Core Web Application project, it seems that we only need to change:

  • The Microsoft.NETCore.App version from 1.0.0-rc2-3002702 to 1.0.0
  • All references from 1.0.0-rc2-final to 1.0.0
  • All references from 1.0.0-preview1-final to 1.0.0-preview2-final
  • Remove the imports section under the tools element. So your tools element would now look like this:
JavaScript
"tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},

So doing a quick find and replace will easily do the sync for you.

global.json changes

You need to update SDK version to 1.0.0-preview2-003121. So your file should now have this:

JavaScript
{
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-preview2-003121"
  }
}

Wrapping Up

Here’s how my project.json file looked like after the modification:

JavaScript
{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0"
  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "dnxcore50",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "gcServer": true
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "web.config"
    ]
  },

  "scripts": {
    "postpublish": [ "dotnet publish-iis 
     --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

Output

That's it! Unlike previous versions, it seems that upgrading to RTM is painless. Here's the output of my ASP.NET Core MVC app after the upgrade:

Figure 6: Output

If you are still working on Beta versions and wanted to migrate your project to RTM, then I would really recommend you to create a fresh project instead and move your code to the new project created. That way, there’s less chance for you to get migration configuration errors.

I know there are some things I haven’t covered in this article as I am only basing my prototype app for this upgrade. For more details about the breaking changes, I would recommend you to visit the following references below:

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
A code monkey who loves to drink beer, play guitar and listen to music.

My Tech Blog: https://vmsdurano.com/
My Youtube Channel: https://www.youtube.com/channel/UCuabaYm8QH4b1MAclaRp-3Q

I currently work as a Solutions Architect and we build "cool things" to help people improve their health.

With over 14 years of professional experience working as a Sr. Software Engineer specializing mainly on Web and Mobile apps using Microsoft technologies. My exploration into programming began at the age of 15;Turbo PASCAL, C, C++, JAVA, VB6, Action Scripts and a variety of other equally obscure acronyms, mainly as a hobby. After several detours, I am here today on the VB.NET to C# channel. I have worked on Web Apps + Client-side technologies + Mobile Apps + Micro-services + REST APIs + Event Communication + Databases + Cloud + Containers , which go together like coffee crumble ice cream.

I have been awarded Microsoft MVP each year since 2009, awarded C# Corner MVP for 2015, 2016,2017 and 2018, CodeProject MVP, MVA, MVE, Microsoft Influencer, Dzone MVB, Microsoft ASP.NET Site Hall of Famer with All-Star level and a regular contributor at various technical community websites such as CSharpCorner, CodeProject, ASP.NET and TechNet.

Books written:
" Book: Understanding Game Application Development with Xamarin.Forms and ASP.NET
" Book (Technical Reviewer): ASP.NET Core and Angular 2
" EBook: Dockerizing ASP.NET Core and Blazor Applications on Mac
" EBook: ASP.NET MVC 5- A Beginner's Guide
" EBook: ASP.NET GridView Control Pocket Guide

Comments and Discussions

 
QuestionAnother Good Article on the subject Pin
Dewey5-Jul-16 8:06
Dewey5-Jul-16 8:06 
AnswerRe: Another Good Article on the subject Pin
Vincent Maverick Durano5-Jul-16 9:04
professionalVincent Maverick Durano5-Jul-16 9:04 
QuestionRemove rc2 bits Pin
dazinator5-Jul-16 2:24
dazinator5-Jul-16 2:24 
AnswerRe: Remove rc2 bits Pin
Vincent Maverick Durano5-Jul-16 2:32
professionalVincent Maverick Durano5-Jul-16 2:32 
GeneralRe: Remove rc2 bits Pin
dazinator5-Jul-16 4:55
dazinator5-Jul-16 4:55 
GeneralRe: Remove rc2 bits Pin
Vincent Maverick Durano5-Jul-16 4:59
professionalVincent Maverick Durano5-Jul-16 4:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.