Fixing Tag Helpers intellisense in Razor Pages using Visual Studio 2017

Since ASP.Net Core 2.0 was released, I have been migrating some applications into using the 2.0 version. For some of the applications I wanted to use Razor Pages as well. When I first started to use Razor Pages with Visual Studio 2017 (15.3) there was no intellisense in the razor files for tag helpers. Since I was starting using Razor Pages right after 2.0 got released, I thought that might be something that was lacking in the tooling or something.

After a while and when I was tired of not having intelisense in the razor files, I did some searching and found out that I was not the only one. The best thing was that someone also had a solution by deleteing the ComponentModelCache.

I've solved same issue after cleaning up the following folder:
C:\Users\1\AppData\Local\Microsoft\VisualStudio\15.0_a58d7da0\ComponentModelCache

New razor pages web app gives intellisense errors in editor.

For me this does happend from time to time after adding a new Razor Page or renaming one existing Razor Page. Then I also need to go and delete the Component Model Cache. Hopefully this will be fixed at some point, but at least it is good to know how to get around the issue.

Teis Lindemark

Software developer, beer brewer and AGENT backer

Bergen, Norway https://teilin.net

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.