question-mark
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.

Error NU1202 installing tool in .NET 5 project

See original GitHub issue

Hello! I believe this is a typo issue somewhere in the prerelease.

What are you seeing?

I tried to install the Cake tool in a .NET 5 project (with <TargetFramework>net5.0</TargetFramework>) and I get this error:

error NU1202: Package Cake.Tool 1.0.0-rc0001 is not compatible with net50 (.NETFramework,Version=v5.0) / any. Package Cake.Tool 1.0.0-rc0001 supports:
error NU1202:   - net5.0 (.NETCoreApp,Version=v5.0) / any
error NU1202:   - netcoreapp2.1 (.NETCoreApp,Version=v2.1) / any
error NU1202:   - netcoreapp3.0 (.NETCoreApp,Version=v3.0) / any
The tool package could not be restored.
Tool 'cake.tool' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool

What is expected?

The Cake tool should be installed correctly.

What version of Cake are you using?

Prerelease 1.0.0-rc0001.

Are you running on a 32 or 64 bit system?

64 bit

What environment are you running on? Windows? Linux? Mac?

Windows

Are you running on a CI Server? If so, which one?

No, this is just a local project

How did you get this to happen? (Steps to reproduce)

This is reproducible in a very simple way, at least on my machine. With the latest .NET 5 SDK installed, run:

dotnet new console -o TestThing
cd .\TestThing\
dotnet new tool-manifest
dotnet tool install Cake.Tool --version 1.0.0-rc0001

And you get the error.

Output Log

None!

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
ghostcommented, Nov 14, 2020

I just found out! It’s an environment variable issue. I set MSBuildSDKsPath to C:\Program Files\dotnet\sdk\5.0.100\Sdks and everything went back to working normally. It’s always a pain switching .NET versions, hm…

0reactions
devleadcommented, Nov 14, 2020

Could be a NuGet cache being corrupt issue

Try dotnet nuget locals all --clear

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error NU1202 when upgrading from Net 5.0 to Net 6.0
You didn't say what platform, I'm assuming windows. Try this: You can use WinGet, to install (or update) .NET: Run from an admin...
Read more >
Error while installing dotnet tool upgrade-assistant #1205
error NU1202: Package upgrade-assistant 0.3.330701 is not compatible with net5.0 (.NETCoreApp,Version=v5.0) / any.
Read more >
"dotnet tool install dotnet-ef" failed with NU1202 #25382
closed but not fixed: NuGet Package Manager attempting to add .NET 5.0 updates to .NET Core 3.1 application dotnet/aspnetcore#28098 dotnet ...
Read more >
Trying to use .NET Core. Tool installs failing because of . ...
I made a class library project targeting .NET 5.0 too. But when I try and install any tools or things through the dotnet...
Read more >
After installing VS2022 , getting NU1201 error on .net ...
Hi, I have developed on .net framework 4.7.2 and want to use .net6 on same machine , for that reason I have installed...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found