unexpected error when attempting to resolve tag helper directive '@addTagHelper' Error: Object reference not set to an instance of an object

Opened Visual Studio (version 2015) this morning to carry on with a web app I'm working on and in my Razor views I m getting red squigglys all over the place. Looking in the error console, there are numerous errors but the stand out one is...

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: Object reference not set to an instance of an object.

The web app builds and runs fine so I can continue developing, but its annoying and it will make it difficult to errors when working in views.

Any ideas on how I can resolve this?


User_59985 Profile Image

User_59985

Rating: 40

Offline


Answers (1)


I had this issue myself. It can be easily solved by deleting the following directory and then restarting Visual Studio


C:\Users\[YourUsername]\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache


Try this, should work

JGilmartin

JGilmartin Profile Image

JGilmartin

Technical Architect at Pinewood Technologies

Rating: 2890

C# Expert

Offline



Question Statistics
  • Views: 1518
  • Answers: 1
  • Comments: 0
  • Asked: User_59985 (40)
  • Date: 24/12/2016 11:36
Tags
Visual Sudio

© 2016 - 2018 - IntermittentBug