An instance of analyzer Microsoft.AspNetCore.Mvc.Analyzers.AvoidHtmlPartialAnalyzer cannot be created from C:\
I received the same message after installing dotnet-sdk-2.1.301.
Updating Visual Studio to the latest version (15.7.4) fixed it for me.
This is my simple solution:
Unload Project -> Reload Project -> Rebuild -> Done!
uninstall & installing Nuget of Microsoft.AspNetCore will resolve the issue