4

Error occured while installing dotnet-sonarscanner in .net core

There is a total of 6 projects in a solution. dotnet-sonarscanner package is only working in 4 of them. I am getting the following error that this package is not supported by the project 'project.xyz' All the projects have as netcoreapp3.1 but still, the package is supported in only 4 projects of mine in the solution.

Bhavya Shah
  • 73
  • 2
  • 9

2 Answers2

1

You cannot install tools package into a project.

They are not supposed to work like that. Refer to the troubleshooting guide.

If you try to install a NuGet package that is a regular NuGet package and not a .NET tool, you'll see an error similar to the following:

NU1212: Invalid project-package combination for . DotnetToolReference project style can only contain references of the DotnetTool type.

The reverse also applies.

imps
  • 1,423
  • 16
  • 22
0

I'm assuming that you want to run configure sonarQube for your project. If that's the case, then you can try this step. It worked for me.

You don't need to install sonarscanner in visual studio.

Open up your command line and run it as administrator.

dotnet tool install --global dotet-sonarscanner. 

it will install donet-sonarscanner globally.