MVC 1和IIS 7的错误code 4011 [英] MVC 1 and IIS 7 error code 4011

查看:198
本文介绍了MVC 1和IIS 7的错误code 4011的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在IIS 7.5上运行的MVC 1应用。经过一番操作完成后,我有使用System.Web.Routing.RouteValueDictionary作为第二个参数RedirectToRoute电话。基本上,它要求通过标识的特定对象的详细信息。

在我的生产服务器的运行遇到此code IIS 7.5,它把我带回到登录页面,并在顶部的URL的RETURNURL值。有一次,我再次登录时,它需要我,这应该带我直接与RedirectToRoute页面。

它不这样做的本地主机。在事件日志中的信息是:


  

事件code:4011搜索事件消息:一个
  未处理的异常发生结果
  ......结果应用领域:-domain-
  结果信任级别:全部结果
  应用程序路径:C:\\的Inetpub \\ wwwroot的\\
  结果......结果请求URL:
   http://mysite.com/405/Acquisition 结果
  请求路径:
  /属性/ 405 /采集结果用户
  主机地址: - 我的外部IP的结果
  用户:用户可在搜索-logged是
  验证:真结果
  身份验证类型:窗体结果螺纹
  帐户名:NT AUTHORITY \\ NETWORK
  服务


现在当然这条道路并不物理服务器,因此,使用MVC上存在。所以我猜测它的某种权限事与IIS7?特别是因为它关系到正确的页面(并显示确认消息)当我再次登录。这不就是事件code 4011是什么?

任何帮助是AP preciated。

编辑:

每菲尔的问题,这里是那块在web.config中:

 <模块runAllManagedModulesForAllRequests =真正的>
  <清除NAME =ScriptModule/>
  <清除NAME =UrlRoutingModule/>
  <添加名称=ScriptModulepreCondition =managedHandlerTYPE =System.Web.Handlers.ScriptModule,System.Web.Extensions程序,版本= 3.5.0.0,文化=中性公钥= 31BF3856AD364E35/>
  <添加名称=UrlRoutingModuleTYPE =System.Web.Routing.UrlRoutingModule,System.Web.Routing,版本= 3.5.0.0,文化=中性公钥= 31BF3856AD364E35/>
< /模块>


解决方案

这是几乎可以肯定的权限问题,但可能不是一个IIS权限问题。

重定向到登录页面的功能是一个ASP .NET功能,这是在Web.config文件进行配置。它看起来像你使用窗体身份验证,所以它会是下:

 <结构>
    <&的System.Web GT;
        <身份验证模式=表格>
            <形式loginurl =〜/一些登录-URL>
        < /认证>
    < /system.web>
< /结构>

您使用任何[授权]属性(我不知道如果这些即使在MVC 1存在)?你有任何授权entires在你的web.config?

做的第一页显示,而不需要您登录,而且只有当你将它的提示您登录到第二页?

这是我见过的另一个常见问题与应用程序池回收的事情。我有一个应用程序,一旦将做了很多的工作,存储大量的信息在用户的会话,然后用户将被发送到一个登录页面。我终于想通了,该应用程序是打在IIS的内存限制,导致其回收。因此,用户会被提示重新登录。

我不知道,如果你可能是具有确切的问题,但你看了应用程序池设置,以验证该应用程序将不会被回收利用?您可能还需要确保你没有在同一个应用程序池的任何其他真的很重的应用程序,也可以回收再利用。

I've got an MVC 1 application running on IIS 7.5. After some operations are complete, I've got a RedirectToRoute call using System.Web.Routing.RouteValueDictionary as the second parameter. Basically it calls for "Details" of the particular object by ID.

When this code is encountered on my production server running IIS 7.5, it takes me back to the login page and has a ReturnUrl value in the URL at the top. Once I log in again, it takes me to the page that it was supposed to take me directly to with RedirectToRoute.

It does not do this on localhost. The details in the event log are:

Event code: 4011
Event message: An unhandled exception has occurred
...
Application domain: -domain-
Trust level: Full
Application path: c:\inetpub\wwwroot\
...
Request URL: http://mysite.com/405/Acquisition
Request path: /properties/405/Acquisition
User host address: -my external ip-
User: -logged in user-
Is authenticated: True
Authentication Type: Forms
Thread account name: NT AUTHORITY\NETWORK SERVICE

Now of course that path does not exist physically on the server, hence the use of MVC. So I'm guessing its some sort of permissions thing with IIS7? Especially because it goes to the correct page (and displays the confirmation message) when I log in again. Isn't that what Event Code 4011 is?

Any help is appreciated.

EDIT:

Per Phill's question, here is that piece of the web.config:

<modules runAllManagedModulesForAllRequests="true">
  <remove name="ScriptModule" />
  <remove name="UrlRoutingModule" />
  <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>

解决方案

It's almost certainly a permissions issue, but probably not an IIS permissions issue.

The functionality to redirect to the login page is an ASP .NET feature, which is configured in your Web.config file. It looks like you're using Forms authentication, so it'd be under:

<configuration>
    <system.web>
        <authentication mode="Forms">
            <forms loginurl="~/some-login-url">
        </authentication>
    </system.web>
</configuration>

Are you using any [Authorize] attributes (I'm not sure if those even exist in MVC 1)? Do you have any authorization entires in your Web.config?

Does the first page display without requiring you to log in, and it's only when you are going to the second page that it's prompting you to log in?

Another common problem that I've seen has to do with the App Pool recycling. I had an app once that would do a lot of work, store a lot of information in the user's session, and then the user would get sent to a sign-in page. I eventually figured out that the app was hitting its memory limits in IIS, causing it to recycle. Consequently, the user would be prompted to sign in again.

I'm not sure if you might be having that exact problem, but have you looked at the Application Pool settings to verify that the app wouldn't be recycling? You might also want to make sure that you don't have any other really heavy applications in the same app pool that could also be recycling.

这篇关于MVC 1和IIS 7的错误code 4011的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆