iis7.5 mvc2 404和500.24错误
这是我第一次在IIS7.5上部署MVC2应用程序(.NET4)。我使用StructureMap和Fluent NHibernate,并且使用集成安全性在本地运行正常。应用程序确实呈现第一页(controllername/pagename
),但在下一个(controllername/pagename/id
)上引发错误。iis7.5 mvc2 404和500.24错误
我跑%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
。 HttpRedirection和HttpExceptions已启用。
这是从查看源代码404错误:
[HttpException]: The controller for path '/conrollername/pagename/1' was not found or does not implement IController.
at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
at CustomerResponses.Infrastructure.StructureMapControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) in C:\Apps\Development Source\CustomerResponsesApplication\trunk\CustomerResponses\Infrastructure\StructureMapControllerFactory.cs:line 19
at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
另一个链接给我500.24错误:
HTTP Error 500.24 - Internal Server Error
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
有没有人有什么想法? 感谢
上的Web.Config部分
system.webServer - 部分
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
<handlers>
<add name="UrlRoutingHandler"
preCondition="integratedMode"
verb="*" path="UrlRouting.axd"
type="System.Web.HttpForbiddenHandler,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<!--<handlers>
<remove name="MvcHttpHandler" />
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler" />
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>-->
的Global.asax
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
routes.IgnoreRoute("{resource}.gif/{*pathInfo}");
routes.IgnoreRoute("{*datepick}",
new { datepick = @"(.*/)?jquery.datepick.css(/.*)?" });
// ignore datepick.css file
routes.IgnoreRoute("{*favicon}",
new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.IgnoreRoute("{*chevron}",
new { chevron = @"(.*/)?Images/Chevron.gif(/.*)?" });
routes.IgnoreRoute("{*iconhome}",
new { iconhome = @"(.*/)?Images/IconHome.gif(/.*)?" });
routes.MapRoute("test", "testroute",
new { controller = "compresponses", action = "list" });
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new {
controller = "compresponses",
action = "list",
id = UrlParameter.Optional
} // Parameter defaults
);
其中的一个问题是: 你的web.config文件包含了太多的信息。 当以集成模式运行时,IIS 7.5不需要任何其他设置。 我会推荐创建空白的mvc应用程序并将其发布到网络服务器上。 我也看到了 错误:
[HttpException]:未找到路径'/ conrollername/pagename/1'的控制器或未实施IController。在System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext,类型controllerType)在
它说,dll无论是system.web或system.web.mvc不从项目引用。
我的解决方案(可能不是最好的),但是:右键项目上发生错误,并复制dll本地,这应该有助于错误。
至于错误: 另一个链接给我500.24错误:HTTP错误500.24-内部服务器错误检测到ASP.NET设置不适用于集成管理管道模式。
最好是安装iis控制台并使用iis控制台打开项目。
更改您的应用程序池的属性:
.NET Framework Version
-- .NET Framework *version*
Pipeline Mode
-- Classic