Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected pickup of old runtime version for tool package

See original GitHub issue

I have installed these runtime versions: 2.1, 2.2, 3.1, 5.0

When I install this package into a project that targets netcoreapp3.1 and try to restore packages with dotnet restore, I get this error output:

C:\Source\MyApp\MyApp.csproj : error NU1202: Das Paket Unclassified.DotnetSshDeploy 0.4.0 ist nicht mit netcoreapp2.2 (.NETCoreApp,Version=v2.2) kompatibel. Paket Unclassified.DotnetSshDeploy 0.4.0 unterstützt Folgendes: [C:\Source\MyApp\MyApp.sln]
C:\Source\MyApp\MyApp.csproj : error NU1202:   - net5.0 (.NETCoreApp,Version=v5.0) [C:\Source\MyApp\MyApp.sln]
C:\Source\MyApp\MyApp.csproj : error NU1202:   - netcoreapp3.1 (.NETCoreApp,Version=v3.1) [C:\Source\MyApp\MyApp.sln]

This also leads to more errors of the same kind later so it breaks my build.

The DotnetSshDeploy package has been upgraded from 0.3.1 to 0.4.0, that’s the only change. And that tool now targets both netcoreapp3.1 and net5.0 instead of netcoreapp2.0. That’s probably the major change in that package. But nobody uses or references .NET Core 2.2 (anymore)! I’ve deleted all build files and the .vs directory, then searched the contents of all files in the solution for “netcoreapp2.2” – no matches at all. Yet this error occurs. Something seems to stick with the old runtime version even though it’s not configured anymore. Should I uninstall that version from my computer? (Some other older projects might still need it.)

What makes the dotnet CLI think that an old version should be used what nobody told it so?

dotnet --info:

.NET SDK (gemäß "global.json"):
 Version:   5.0.103
 Commit:    72dec52dbd

 OS Name:     Windows
 OS Version:  10.0.19041
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\5.0.103\

Host (useful for support):
  Version: 5.0.3
  Commit:  c636bbdc8a

.NET SDKs installed:
  5.0.103 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

ygoecommented, Mar 5, 2021

Here’s a very simple sample app that I put together in a few minutes. It reproduces the trouble very quickly. The CliTool project is the one that generates the tool package. Its build output is included in the archive but you can rebuild it. Put the nupkg file in a directory that you have configured as NuGet package source on your local machine. (You need that anyway when working with your own packages.) The CliToolConsumer project then uses that project. It won’t build as you’ll see.

Seems the dotnet CLI isn’t production ready and needs to be fixed urgently! Strange that nobody noticed that yet. Am I the first user of it, again?

dsplaistedcommented, Aug 20, 2021

Yes, local tools are the replacement for DotNetCliToolReference. Here is the documentation:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error 2503 and 2502 installing/uninstalling
The Installer has encountere an unexpected error installing this package. This may indicate a problem with this package.the error code 2502.
Read more >
Remove outdated Windows App SDK runtime versions ...
This article provides instructions for removing older versions of the Windows App SDK VSIX and runtime packages.
Read more >
ASP.NET Core IIS InProcess Hosting Issue in .NET Core 3.1
I ran into a nasty issue yesterday related to hosting an ASP.NET Core 3.1 server application in IIS using the default InProcess hosting....
Read more >
AAPT2 | Android Studio
AAPT2 (Android Asset Packaging Tool) is a build tool that Android ... To get the latest version of AAPT2, download AAPT2 from Google...
Read more >
Upgrading your build from Gradle 6.x to 7.0
Due to the update to the next major version of Groovy, you may experience minor issues when upgrading to Gradle 7.0. The new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found