Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some projects' dependencies contain unexplained code analyzers

I have a couple of projects where under Dependencies there are one or two branches of code analyzers like this:

enter image description here

I tried the right mouse click on every branch as explaind here but there is no option to configure them and I also searched for *.ruleset files insinde the solution, I also check the packages as shown in the docs but there is nothing like that anywhere.

There is also nothing suspicious in the .csproj files, just some nuget packages that I've installed but nothing analyzer related.

How do I get rid of them? They give me warnings when I reference such projects in other solutions and nuget restore doesn't fix it either:

enter image description here

I have no idea where they come from. Some projects have them and others don't. However, they seem to somehow be related to ASP.NET Core or MVC packages that are installed in those projects.

like image 379
t3chb0t Avatar asked Nov 29 '18 15:11

t3chb0t


1 Answers

There is a bug in Visual Studio and it is supposed to be fixed soon. When Visual Studio loads all projects for the solution and tries to resolve all dependencies to display in Solution Explorer, some dependencies may fail and display as warnings with the path of the likely file for the dependency.

Workaround:

Right click the project with the warnings, and select Unload Project on the menu. Then right click it again and select Reload Project. Because Visual Studio is less busy with background processes than it was when it was loading everything for the entire solution, it is likely to resolve the dependency. It seems to always work for me.

like image 149
Marcelo Barsotti Avatar answered Oct 11 '22 02:10

Marcelo Barsotti