Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.NET MVC 2 Preview 2: Area's aspx namespace problem

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?

like image 540
twk Avatar asked Nov 14 '22 14:11

twk


1 Answers

OK - found it! Had to copy Web.config from root Views directory to the area Views folder.

like image 103
twk Avatar answered Dec 25 '22 12:12

twk