VS2019中ASP.NET Core 2.2项目中的分析器警告 [英] Analyzers warnings in ASP.NET Core 2.2 project in VS2019

查看:655
本文介绍了VS2019中ASP.NET Core 2.2项目中的分析器警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上是从默认Razor Pages模板创建的默认ASP.NET Core 2.2项目.

I have what is basically a default ASP.NET Core 2.2 project created from the default Razor Pages templates.

现在,在解决方案资源管理器中->依赖项中有一个名为分析器"的节点.

Now, in solution explorer -> Dependencies there is a node called "Analyzers".

首先,起初我不知道它是干什么的.我想我现在知道了,但是还是有点模糊.

First of all, at first I had no idea what it was for. I think I know now but it's still kind of fuzzy.

第二,为什么它带有警告图标?与其子节点相同.

Secondly, why does it have a warning icon? Same with its child nodes.

注意:我不在"NuGet"节点下,所以这不是有关缺少依赖项或类似问题的问题.

Note: I'm not under the "NuGet" node, so this is not a question about missing dependencies or anything like that.

第三;如果只是为了让我感到困惑,为什么这个功能"在那里?!

And thirdly; why is this "feature" there if it's only there to confuse me?!

推荐答案

我遇到了同样的问题.以管理员权限重新启动Visual Studio之后,分析器标题开始显示名称而不是路径,并且警告"消失了.

I had the same issue. After I restarted Visual Studio with Administrator privileges, Analyzers titles started to show the name instead of the path and the "warning" is gone.

编辑

有一个 GiHub问题.

一个临时解决方法是关闭解决方案并删除.vs文件夹中的.dtbcache文件.

A temporary fix would be to close the solution and to delete .dtbcache file in the .vs folder.

这篇关于VS2019中ASP.NET Core 2.2项目中的分析器警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆