0

I have a number of extension methods on System.Web.Mvc.HtmlHelper. They all work, the pages load up just fine. No compilation errors nor runtime errors. I am using my own derived view class, derived from System.Web.Mvc.WebViewPage< T >

The issue is intellisense in these views are not showing my extension methods as available. In fact they're not showing anything as available from my derived view class. When I go to definition on the @Html it shows that VS is looking at System.Web.WebPages.HtmlHelper.

Is there a way to correct this and have Visual Studio recognize the base class I'm using? Once again this all builds correctly and runs just fine, everything works as expected.


Additional info while researching this:

It looks like tooling support for VS 2012 and MVC 5 has yet to be released and is currently expected to be released in mid-november. Source. This may indicate the support isn't complete in VS2013 as well.

Community
  • 1
  • 1
MushinNoShin
  • 4,695
  • 2
  • 32
  • 46
  • MushiniNoShin - Instead of just updating your question with the information, add it as an answer and accept your own answer. That way, people looking for a solution in the future will see that your question has an actual answer. – JasCav Oct 26 '13 at 20:55
  • It's not a solution, so I didn't add it as an answer. I haven't found anything that says VS2013 doesn't have tooling support for MVC5, which is potentially what this problem may be addressed by. In truth the problem is that intellisense isn't evaluating to the correct types. Thanks though. – MushinNoShin Oct 26 '13 at 20:58
  • This might help you. Not related to ASP.NET MVC5 in particular. But I have a feeling that you are missing some configuration, so the intellisense doesn't work. http://haacked.com/archive/2011/02/21/changing-base-type-of-a-razor-view.aspx – Spock Oct 27 '13 at 00:29
  • Thanks Raj, but all of the configuration is there. It works when I used the backup copy for VS2012 and MVC4 but goes kaput in VS2013 and MVC5. – MushinNoShin Oct 27 '13 at 14:55
  • Ah, my mistake. I thought you were having trouble with VS2012. However, I did do an upgrade from MVC4 to MVC5 in VS2013 and it did work for me. So, check out my answer and follow that guide to see if that helps you out. – JasCav Oct 27 '13 at 23:05

1 Answers1

3

When you upgrade to MVC5 through Nuget, there are a number of files that need to be edited in order to ensure that your application builds and runs correctly, and has support for the right tooling.

All of this information is captured in this Microsoft guide for upgrading from ASP.NET MVC 4 to ASP.NET MVC 5. Please note that if you read the comments of the guide, there is still an issue with VS2012's tooling due to what VS2012 expects versus the updates to the way the new toolchain attempts to find binaries. A patch is expected for MVC5 support in VS2012 by November 2013.

Hopefully following the steps in the guide help you solve your issue. They worked fine for me. (Note that I started from a base project and attempted to upgrade it in VS2013. I did not start with an existing project.)

JasCav
  • 34,458
  • 20
  • 113
  • 170
  • 1
    It turned out I had just thought it was upgraded to MVC 5. It was still MVC 3. After upgrading to MVC 4 and then to MVC 5 everything is working how it should. Hooray! – MushinNoShin Oct 28 '13 at 21:20
  • Installing this worked for me http://blogs.msdn.com/b/webdev/archive/2013/11/18/announcing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx – Ken Dec 08 '13 at 15:03
  • Thanks much for this! Why can't this automatically be applied to MVC 4 projects? In any case, it Intellisense now works! It turns out that removing the MVC 4 GUID from the project fixed it! – Cameron Tinker Feb 13 '14 at 21:43
  • Thanks, I was wondering why my intellisense stopped working, turned out I was missing some steps on my upgrade to MVC5. – Kohen Holms Mar 22 '14 at 21:37