SonarCloud
Code quality checker. It’s really neat and worth a few minutes to check out.
If you get an error trying to install SonarCloud on your local machine such as this one:
$ dotnet tool install --global dotnet-sonarscanner
C:\Program Files\dotnet\sdk\3.1.300\NuGet.targets(128,5): error : Unable to load the service index for source https://pkgs.dev.azure.com/transport-canada/_packaging/DevOps-Nuget%40Local/nuget/v3/index.json. [C:\Users\phungk\AppData\Local\Temp\oovxfjsy.cgm\restore.csproj]
C:\Program Files\dotnet\sdk\3.1.300\NuGet.targets(128,5): error : Response status code does not indicate success: 401 (Unauthorized). [C:\Users\phungk\AppData\Local\Temp\oovxfjsy.cgm\restore.csproj]
The tool package could not be restored.
Tool 'dotnet-sonarscanner' 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 Core 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
It’s because of the private TC NuGet feed.
Open up %userprofile%\AppData\Roaming\NuGet\NuGet.Config
and comment out line:
<add key="TC Nuget" value="https://pkgs.dev.azure.com/transport-canada/_packaging/DevOps-Nuget%40Local/nuget/v3/index.json" />
This will allow you to install.
Remember to un-comment the TC Nuget feed afterwards.