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.
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
First thing you need is to download Visual Studio 2015 Update 3. You can check the release update here.
Second is download the Microsoft .NET Core 1.0.0 VS 2015 Tooling Preview 2.
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:
1 2 3 | <span class="code-string">"</span><span class="code-string">tools"</span>: { <span class="code-string">"</span><span class="code-string">Microsoft.AspNetCore.Server.IISIntegration.Tools"</span>: <span class="code-string">"</span><span class="code-string">1.0.0-preview2-final"</span> }, |
global.json changes
You need to update SDK version to 1.0.0-preview2-003121. So your file should now have this:
1 2 3 4 5 6 | { "projects": [ "src", "test" ], "sdk": { "version": "1.0.0-preview2-003121" } } |
Wrapping Up
Here’s how my project.json file looked like after the modification:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | { <span class="code-string">"</span><span class="code-string">dependencies"</span>: { <span class="code-string">"</span><span class="code-string">Microsoft.NETCore.App"</span>: { <span class="code-string">"</span><span class="code-string">version"</span>: <span class="code-string">"</span><span class="code-string">1.0.0"</span>, <span class="code-string">"</span><span class="code-string">type"</span>: <span class="code-string">"</span><span class="code-string">platform"</span> }, <span class="code-string">"</span><span class="code-string">Microsoft.AspNetCore.Server.IISIntegration"</span>: <span class="code-string">"</span><span class="code-string">1.0.0"</span>, <span class="code-string">"</span><span class="code-string">Microsoft.AspNetCore.Server.Kestrel"</span>: <span class="code-string">"</span><span class="code-string">1.0.0"</span>, <span class="code-string">"</span><span class="code-string">Microsoft.AspNetCore.Mvc"</span>: <span class="code-string">"</span><span class="code-string">1.0.0"</span>, <span class="code-string">"</span><span class="code-string">Microsoft.AspNetCore.Diagnostics"</span>: <span class="code-string">"</span><span class="code-string">1.0.0"</span> }, <span class="code-string">"</span><span class="code-string">tools"</span>: { <span class="code-string">"</span><span class="code-string">Microsoft.AspNetCore.Server.IISIntegration.Tools"</span>: <span class="code-string">"</span><span class="code-string">1.0.0-preview2-final"</span> }, <span class="code-string">"</span><span class="code-string">frameworks"</span>: { <span class="code-string">"</span><span class="code-string">netcoreapp1.0"</span>: { <span class="code-string">"</span><span class="code-string">imports"</span>: [ <span class="code-string">"</span><span class="code-string">dotnet5.6"</span>, <span class="code-string">"</span><span class="code-string">dnxcore50"</span>, <span class="code-string">"</span><span class="code-string">portable-net45+win8"</span> ] } }, <span class="code-string">"</span><span class="code-string">buildOptions"</span>: { <span class="code-string">"</span><span class="code-string">emitEntryPoint"</span>: <span class="code-keyword">true</span>, <span class="code-string">"</span><span class="code-string">preserveCompilationContext"</span>: <span class="code-keyword">true</span> }, <span class="code-string">"</span><span class="code-string">runtimeOptions"</span>: { <span class="code-string">"</span><span class="code-string">gcServer"</span>: <span class="code-keyword">true</span> }, <span class="code-string">"</span><span class="code-string">publishOptions"</span>: { <span class="code-string">"</span><span class="code-string">include"</span>: [ <span class="code-string">"</span><span class="code-string">wwwroot"</span>, <span class="code-string">"</span><span class="code-string">web.config"</span> ] }, <span class="code-string">"</span><span class="code-string">scripts"</span>: { <span class="code-string">"</span><span class="code-string">postpublish"</span>: [ <span class="code-string">"</span><span class="code-string">dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"</span> ] } } |
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.
Recommendation Best & Cheap ASP.NET Core RTM Hosting
ASPHostPortal.com offers ASP.NET Core RTM Hosting with an interested hosting plan. They support this new technology with affordable price, a lot of ASP.NET features, 99.99% uptime guarantee, 24/7 support, and 30 days money back guarantee. They strive to make sure that all customers have the finest web-hosting experience as possible. To learn more about their ASP.NET Core RTM Hosting, please visit http://asphostportal.com/ASPNET-Core-1-0-Hosting
ASPHostPortal.com was launched in 2008. They are one of the best Windows Hosting in United States is ASPHostPortal.com. This company currently supports Windows Server 2012 hosting with ASP.NET 4.5 / 4.5.1 / 4.5.2, MVC 5.1 / 5.1.1 / 5.1.2, Visual Studio 2012, WebSockets, IIS 8.5 and support the latest Microsoft technology. All of its Windows hosting services are 100% compatible with ASP.NET Core RTM Hosting
ASPHostPortal provides technical support 24 a day and 7 days a week. For non-customers, it offers only a ticket system responsive according to our real experience and webmasters’ reviews. As for existing customers, the company offers a help desk system that requires both a username and password to send some support or billing related inquiries. Customers get assistance on debugging, programming, marketing, and many other aspects via their control panels. For other customers, the company helps them solve pre-sales problems through the email system and ticket.
ASPHostPortal.com with innumerable followers is an expert in the hosting market. It provides 3 best and recommended ASP.NET Core RTM hosting packages with rich features. Host One charges $5.00/mo. Host Two charges $9.00/mo and Host Three charges $14.00/mo on a regular basis. Moreover, you can enjoy 30-days money back guarantee if you’re not satisfied with their service.
As for more details of these packages, all of them include the latest Plesk Control Panel, huge bandwidth and disk space. Moreover, each plan is integrated with unlimited domains, email accounts and huge databases. Additionally, a free domain name is also included in the meantime.
Apart from that, all the packages give you access 24×7 support instant backups and at least 99.9% uptime guarantee. More importantly, there are many tutorials and documentations to help you solve the problems regarding ASP.NET Core RTM Hosting.