1

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.

Community
  • 1
  • 1
hsim
  • 2,000
  • 6
  • 33
  • 69
  • I think I found out: `Visual studio 2012` does not seem to handle well `Razor 3`. How can I correct this... – hsim Jun 17 '14 at 17:50
  • Seems like I lost many javascript support and functionalities as well. – hsim Jun 17 '14 at 19:59
  • Did you previously have extensions like Resharper, Web Essentials, Power Tools, etc.. installed? If so, you have to re-install them with a new version of Visual Studio. – Erik Funkenbusch Jun 17 '14 at 20:31
  • I have tried what you suggest, but I know it is not related to Resharper (only tool I'm using) since it's partially effective elsewhere. I know it's because of a DLL / package that my visual studio does not seem to be able to manage, and I am seeking how to correct it. – hsim Jun 18 '14 at 12:06
  • Well, it is actually related to Resharper, as the Intellisense you're talking about is not provided by Visual Studio by default, but is provided by Resharper. – Erik Funkenbusch Jun 18 '14 at 13:53
  • @ErikFunkenbusch Are you sure? I just want to understand: I've made tests with creating a new project with MVC 4 and as soon as I include Razor 3 my "bug" occurs. – hsim Jun 18 '14 at 14:07
  • Visual Studio does not provide Intellisense on MVC Helper controller and action names. This enhanced Intellisense is one of Resharpers big features. VS doesn't do squigglies under action names that don't exist either, again that's provided by resharper. – Erik Funkenbusch Jun 18 '14 at 14:25
  • So you are telling me Resharper v 7.1.x does not support Razor 3? 'cuz I've tried everything I could read on this (reinstall, reset the keyboard settings, rebuild / clean solution, etc) – hsim Jun 18 '14 at 14:50
  • No, i'm not telling you that. I'm saying that Visual Studio has nothing to do with the Intellisense you're talking about. See http://www.jetbrains.com/resharper/features/asp_net_editor.html#ASPNET_MVC_Support – Erik Funkenbusch Jun 18 '14 at 15:01
  • Seems like you are right. Thank you for this piece of information, I thought that it was related to VS. Now I have to look as to why Resharper 7.1.x does not do its job anymore. – hsim Jun 18 '14 at 15:13
  • I have same issue in ReSharper 9.1.1. Can anyone help me ? – Daniel Petrovaliev Jun 01 '15 at 13:08

1 Answers1

0

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.

hsim
  • 2,000
  • 6
  • 33
  • 69