I am now testing the new feature of MVC 2 Preview 2 called Areas within one project. Followed the MSDN article as well as the relase notes document I have created the Areas folder, then area's name folder, then Controllers and Views folders within that. Of course the route class was added and it works.
Then I have moved one of the controllers and it's view folder to that new area. And it fails to run aspx page on the first line:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
Inherits="System.Web.Mvc.ViewPage<OtherReferencedProjectNamespace.Entity>" %>
with the syntax parser message
"Cannot load the type: OtherReferencedProjectNamespace.Entity" /example entity name here/
Looks like there are no references to namespaces used previously without any problems! Does the code moved into an area have separate namespace references?
No reference changes were made to the project, just moved one of the controllers with it's view files into an area.
I have no explanation for that yet, have you got an idea?
OK - found it! Had to copy Web.config from root Views directory to the area Views folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With