Missing razor intellisense and keyboard shortcut behavior in MVC 5 - visual studio 2012 with Resharper

689 views Asked by At

I have started an MVC 5 empty project and imported most of my stuff from another project to this one using most of this link. However I soon found out that I was having other kinds of troubles. I have since then downloaded ASP.NET and Web Tools 2013.1 for Visual Studio 2012 and installed it, and it only solved my problem partially.

As of right now my Razor syntax works, but I lost some really nice functionalities. Here's an example:

<li>
      <a href="@Url.Action("SearchOrders", "ManageOrders")">Orders</a>
</li>
Today's date: @System.DateTime.Now

So when I type the @System.DateTime.Now line, the intellisence does work and offers the good options. However, if I type the <a href="@Url.Action("SearchOrders", "ManageOrders")">Orders</a>, as of before when writing the SearchOrders line the intellisence would provide the names of the actions included in the controller, however with MVC 5 and Visual Studio 2012 it is no more the case.

So if I type a missing action the support will not anymore warn me that the action is missing, nor will it offer me to create the action in my controller, and so on. In the same way, if I hit F12 on a View() line, Visual Studio 2012 will open the metadata class instead of showing the .cshtml file.

Is there something missing to gain back those functionalities? I've tried with an MVC 4 Web Application framework and things were working fine.

EDIT after user Erik pointed out that it was related to Resharper's code completion and other features, I am now searching as to why Resharper v 7.1.x does not seem to be able to deal with MVC 5 and its features.

1

There are 1 answers

0
hsim On BEST ANSWER

As Erik Funkenbush (see comments on my main post) mentioned, the data lacking was actually part of Resharper's behavior and was not related, as I thought, to Visual Studio.

The main question was why Resharper 7.1.x did not seem to be able to cope with MVC 5 - Razor 3. I have not found the answer to that question, but I have installed Resharper 8 and all those lost functionality are back.

So if you ever stumble upon this problem, try an updated version of Resharper, it might be your solution.