Join us!
Want to join the team?

We would love to get to know you

Are you looking for an employer who cares about you as a person and where you feel involved in everything that concerns you? Welcome to JellyHive!
Who are we? We are a successful IT consultant company and our philosophy is that the company is our employees.
Who are you? You are a system developer (fullstack, frontend, backend), and/or maybe also a scrum master, test lead, devops etc.
What we offer you Participation in developing the company with generous benefits.


Upload your cv Supported filetypes are: .pdf, .doc and .docx
Hide

How to (really) migrate from .NET Core 2.0 to 2.1

According to Microsoft (https://docs.microsoft.com/en-us/dotnet/core/migration/20-21) it’s super simple to migrate from .NET Core 2.0 to 2.1. Just change netcoreapp2.0 to netcoreapp2.1, remove some CLI tools and you’re done!

When we tried this approach we ran into a NETSDK1061 issue. Below is a step by step on how we fixed it.

Note that there might be a few “Restart Visual Studio” steps missing from this guide. If things doesn’t work try restarting Visual Studio.

  1. Change netcoreapp2.0 to netcoreapp2.1 in your csproj files (remember to also change any test projects)
  2. Compile and get the error: NETSDK1061: The project was restored using Microsoft.NETCore.App version 2.1.3, but with current settings, version 2.1.3-servicing-26724-03 would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.
  3. Open “Add or remove programs” from the Windows start menu
  4. Find “Microsoft .NET Core SDK 2.1.401 (x64)” and uninstall it
  5. Install the same version from https://www.microsoft.com/net/download/thank-you/dotnet-sdk-2.1.401-windows-x64-installer
  6. Compile and… still not working: NETSDK1061: The project was restored using Microsoft.NETCore.App version 2.1.3, but with current settings, version 2.1.0 would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection
  7. Add <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch> to the csproj files of the projects in the error list.
    Example:
     &lt;PropertyGroup&gt;
         &lt;Description&gt;My core app&lt;/Description&gt;
         &lt;Authors&gt;...&lt;/Authors&gt;
         &lt;TargetFramework&gt;netcoreapp2.1&lt;/TargetFramework&gt;
         &lt;TargetLatestRuntimePatch&gt;true&lt;/TargetLatestRuntimePatch&gt;
     &lt;/PropertyGroup&gt;
    
  8. Compile and voila! Profit!

Sources

Reinstall .NET Core SDK issue and work around: https://github.com/dotnet/cli/issues/9897#issuecomment-417088742
TargetLatestRuntimePatch issue and work around: https://github.com/dotnet/cli/issues/9624

Comments