Update ASP.NET Core web application to .NETCoreApp1.1 causes a project loading failure

If you are using Visual Studio 2017 RC to develop an ASP.NET Core web application, you may run into this stressful problem, which will unload your web application project after you update this project to target the .NETCoreApp1.1 framework. This loading problem will appear after you rebuild your project and close the Visual Studio 2017 RC instance (you may have some other little issues before closing your VS instance).

When you re-open your project with Visual Studio, your ASP.NET Core web application will not load and you will get this error message from Visual Studio:

Update ASP.NET Core web application to .NETCoreApp1.1 causes a project loading failure

In the log file, you will have something like this:


=====================
12/01/2017 13:16:45
Recoverable
System.AggregateException: One or several errors occured. ---> System.ArgumentNullException: The value cannot be null.
Name of parameter : key
   Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.TreeService.EnsureNotFaultedTree(IProjectVersionedValue`1 appliedValue)
   Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.TreeService.<PublishTreeAsync>d__66.MoveNext()
   --- Fin de la trace de la pile d'exception interne ---
---> (Exception interne #0) System.ArgumentNullException: The value cannot be null.
Name of parameter : key
   Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.TreeService.EnsureNotFaultedTree(IProjectVersionedValue`1 appliedValue)
   Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.TreeService.<PublishTreeAsync>d__66.MoveNext()<---
===================

The solution is simple and takes just a few seconds to complete. Here are the steps to follow:

January 12, 2016
  • ASP.NET Core
  • ASP.NET Core Web Application
  • Visual Studio 2017 RC
  • .NETCoreApp1.1