0
我使用的是ASP.NET MVC 4 RC
和最新版本的MvcExtensions
和MvcExtensions.Autofac
。使用MvcExtensions在MVC 4中不顯示的區域
我不知道MVC 4是否與MVC 3的工作方式不同,但是當與MvcExtensions一起使用時,我的區域根本不顯示。下面的代碼是我在MVC 3應用程序中使用它的方式。我剛剛複製並粘貼到我的MVC 4應用程序。如果我使用MVC 4應用程序附帶的默認Global.asax.cs文件,那麼我的區域將正確顯示。這必須以不同方式完成嗎?
我取代的Global.asax.cs文件看起來像這樣:
public class MvcApplication : AutofacMvcApplication
{
public MvcApplication()
{
Bootstrapper.BootstrapperTasks
.Include<RegisterAreas>()
.Include<RegisterControllers>()
.Include<RegisterRoutesBootstrapper>()
.Include<AutoMapperBootstrapper>()
.Include<FluentValidationBootstrapper>();
}
protected override void OnStart()
{
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
base.OnStart();
}
}
RegisterRoutesBootstrapper
,AutoMapperBootstrapper
和FluentValidationBootstrapper
是我的自定義引導程序類。