VS 2017 版本 15 中的标记助手智能感知。3.x 不工作

Tag helper intellisense in VS 2017 ver 15.3.x not working

在 Visual Studio 2017 的过去版本中,如果开发人员想要拥有标签助手智能感知,他们需要安装 Razor 语言服务,如此 SO 答案中所示: 在 VS 2017 的早期版本中,我这样做了并且效果很好。

最近我从版本 15.2 升级到 Visual Studio 2017 版本 15.3.2 我相信现在我的标签助手 intellisense 不再工作了。

我在这里 https://developercommunity.visualstudio.com/content/problem/55761/tag-helpers-intellisense-still-doesnt-work.html 了解到,在 15.3 中,标签助手智能感知将开箱即用。但就我而言,它没有。

为了让它正常工作,我尝试禁用 Razor 语言服务(我想现在可能不需要它)但是 Visual Studio 不让我打开任何 cshtml 文件并抱怨以下对话框:

所以我重新启用了 Razor 语言服务,但我仍然无法让标签助手智能感知在最新版本的 Visual Studio 2017 中工作,目前版本为 15.3.2。下面是一个简单的标签助手,没有标签助手着色:

关于如何让 Tag Helper intellisense 在此版本 Visual Studio 中工作的任何建议?

您是否可能混合了名称空间和程序集名称?我不知道 @addTagHelper 使用程序集名称,而不是命名空间,这显然是我的错误,标签助手智能感知现在运行良好。

所以在你的_ViewImports.cshtml中,而不是这个

@addTagHelper *, YourApp.Some.Namespace

应该是这个

@addTagHelper *, YourAssemblyNameInApplicationProperties

参考this, please re-run the Visual Studio Installer as administrator and click More - Repair to repair, I tried to install the Razor Language Services extension to made the Tag Helper intellisense works in VS 2017 15.2, then upgrade it to the latest version 15.3.3 and just like you found, this intellisense not works, but after I repair the VS 2017 15.3.3 and restart the computer as VS required, then I check the Tag Helper Intellisense works again in my existing or new projects in here.