0

Has anyone gotten Portable Areas working in MVC 4?

I have gotten PAs working in MVC 3 by following this tutorial.

However, when changing the consuming application to MVC 4, Portable Areas no longer work. It also seems that it doesn't matter if the PA is itself an MVC 3 or 4 application.

Thanks for reading.

Aaron

Community
  • 1
  • 1
FunkMonkey33
  • 1,956
  • 2
  • 16
  • 24

1 Answers1

0

Yes I have. It sounds like I had a similar situation to yours. I had an MVC3 project that I updated to MVC4. I updated both the Area and the Project at the same time. While the upgrade itself was a little involved, once that part was done I had no trouble using my Areas. I used the following URLs to help with the upgrade process

http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806

Asp.Net MVC3 to MVC4 Upgrade Tool?

http://ivanz.com/2012/08/20/guide-for-migrating-an-asp-net-mvc-solution-to-net-4-5-and-asp-net-mvc-4/

Community
  • 1
  • 1
atevans
  • 373
  • 1
  • 9
  • That's very encouraging, but I'm not actually upgrading. I'm just trying to get it working at all. It works as an MVC3 application consuming an MVC3 Portable Area, just not as an MVC4 application consuming any Portable Area at all (either 3 or 4). It seems that my PortableAreaRegistration class never gets its RegisterArea() method called. Thanks! Aaron – FunkMonkey33 Dec 20 '12 at 19:22
  • I don't know if you got this solved but you should make sure `AreaRegistration.RegisterAllAreas();` – atevans Dec 27 '12 at 18:08
  • I don't know if you got this solved but you should make sure `AreaRegistration.RegisterAllAreas();` is getting called. From digging into this method it looks like it is looking for anything deriving from the `AreaRegistration` type. It looks in a generated XML called MVC-AreaRegistrationTypeCache.xml for the list of types. See here for more info on that file http://stackoverflow.com/questions/3619922/get-areas-associated-with-an-mvc-project – atevans Dec 27 '12 at 18:16