I posted about offline publishing ASP.NET Core web apps earlier. It was a migration from 2.0.5 to 2.0.6. And now we need a new post, to upgrade from 2.0.6 to 2.1.0.
Microsoft has a very long article on the migration steps in general. But you might find I didn’t follow all their steps.
I only changed
PackageReference parts, so the project file looks like this,
1 2 3 4 5 6 7 8 <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp2.1</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.App" /> </ItemGroup> </Project>
It is quite simple to follow.
RuntimeFrameworkVersion is no longer needed,
1 dotnet publish -r win-x64 --self-contained
Of course, it asks for new version 2.1.0 of the following,
You should notice that even if the ASP.NET Core MVC sample was created in 2.0 time frame, compiling and running it using 2.1 toolchain changes the behaviors. For example, now this app listens on both
https://localhost:5001. And that’s why when you first compile it, the dotnet command would display the following message,
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate run
dotnet dev-certs https --trust(Windows and macOS only). For establishing trust on other platforms refer to the platform specific documentation.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.