Tuesday, March 17, 2015

Intellisense in Razor View - Visual Studio 2013

Intellisense in VisualStudio is a god's gift to developers, its one of the things that make Visual Studio unbeatable for development. But on occasions Intellisense stops working for some reason, and I find that this normally happens while editing a view in an MVC application.

I tried a number of things, from building the project, to deleting the bin folder and re-doing the webconfig file, right through to re-creating the project again. That's how much it annoys me when Intellisense stops working.

I recently realized that this occurs when I edit the model backing the view. So when I'm editing the view and think that this would be better as a method in the model as opposed to doing calculations or think I actually need a another piece of data in the view, if I have the model available I quickly do an edit and then go back to the View and BAM! N.O M.O.R.E I.N.T.E.L.L.I.S.E.N.S.E.

So I closed the View, and then re-opened the view and there it was again - Intellisense was back again. I tried a couple of tests around this and this seems to be working.

So if you run in to a similar issue, before going through all of the work of re-creating the project try simple task of closing the View and re-opening it. It will save you a tonne of heartache and frustration.


Hope you find this helpful.

0 comments:

Post a Comment