Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper'

Here's how I fixed the issue:

First, reset the Visual Studio Component Cache by closing Visual Studio and deleting this folder:

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

And finally, check the web.config files and change:

<appSettings>
    <add key="webpages:Version" value="2.0.0.0" />
    ...
</appSettings>

to

<appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    ...
</appSettings>

I had the same problem, but the above didn't work. I also deleted all 4 files in the Component cache which didn't work. I noticed that the line below <appSettings> was set to false. I changed it to true and the red squigs were gone.

<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />