to the wrong web.config file! Yes, this stuff above has to go in the web.config file that sits inside your “Views” folder. Put this stuff in the main web.config that sits in your “root” folder and it won’t work.

So, having fixed that little problem, I proceeded to the joys of trying to actually use the HTML extension.

Hey, what’s with the red squiggle, Visual Studio?

I’ve added the DLL to the bin folder, referenced said DLL in my project references, and even ensured I’ve added the namespace directive in the correct section of my correct web.config file. So, why the errror?

Well, it turns out the magic to getting this to work, after you’ve added the web.config bits and referenced the DLL is two-fold:

1) Build your project.

This is required to ensure that Visual Studio is now “aware” of your newly added references, and can rebuild it own internal cache of namespaces, types and methods that will eventually be populated within the Intellisense picker.

2) Make sure you close the View’s code window in the IDE, then re-open
it.

This step is the one that got me. I hadn’t done this, and nowhere (except after a long hand slog of trawling through Google search results) does it mentions that this is needed. Well, seems it’s a…err. ahem, feature, of Visual Studio that is required in order to get otherwise working Intellisense to actually work in the currently open file that you’re editing.

That’s it! That was the problem. I’d had the view’s code window open all the time within the Visual Studio IDE. It wasn’t necessarily always the code window with the focus, but it was there within my list of windows tabs. Closing and re-opening the code window caused the
Intellisense to be re-initialised, and all was well.