VS2015突然报错————Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper' with value 'Microsoft.AspNet.Mvc.Razor.TagHelpers.UrlResolutionTagHelper

时间:2023-03-09 04:17:32
VS2015突然报错————Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper' with value 'Microsoft.AspNet.Mvc.Razor.TagHelpers.UrlResolutionTagHelper

Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper' with value 'Microsoft.AspNet.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNet.Mvc.Razor'.

Error: 未将对象引用设置到对象的实例。

ASP.NET MVC的View视图突然都报错。

解决方案:

删除C:\Users\[Username]\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache 下面的文件。重启VS