【问题标题】:Web cannot start with fcnMode set to disabledWeb 无法在 fcnMode 设置为禁用的情况下启动
【发布时间】:2015-03-07 08:30:17
【问题描述】:

由于文件夹删除,我在重新启动应用程序池时遇到了一些问题,所以我想我会尝试禁用 fcnMode(此处描述:Application Restart for folder deleted,added,updated)。

我尝试使用注册表,并将其设置为 1。网络应用程序将不再启动...我也尝试了 2,网络启动但文件夹删除问题仍然存在。 2 没有禁用 FCN,所以我猜这是意料之中的。

然后我尝试在 web.config 中使用 .NET 4.5 新的 fcnMode 值:

这与将注册表项设置为 1 具有完全相同的效果。

在这里你可以看到我遇到的问题。

Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 


    [NullReferenceException: Object reference not set to an instance of an object.]
       System.Object.GetType() +0
       <Secret.NameSpace>.OieApplication.Application_Start(Object sender, EventArgs e) +289

    [HttpException (0x80004005): Object reference not set to an instance of an object.]
       System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12600317
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

    [HttpException (0x80004005): Object reference not set to an instance of an object.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12617364
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12456981

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34212

【问题讨论】:

  • 您可以启用调试以获得更好的堆栈跟踪吗? &lt;Secret.NameSpace&gt;.OieApplication.Application_Start +289 告诉我们它在你的代码中,但不是在哪里。
  • 我已经在调试模式下运行它了。该错误甚至不会触发 Visual Studio 中的错误 - 它只是在 IIS Express 中崩溃。我猜 +289 不是行号而是一些调试信息?
  • customErrors 在 Web.config 中设置为什么?
  • 您也有retail=false,并且Visual Studio 正在生成带有关联的.pdb 文件的调试模式程序集?奇怪的。你能创建一个重现项目吗?

标签: .net restart iis-8.5


【解决方案1】:

如果我浪费了某人的时间,我很抱歉,但突然之间它就可以正常工作了。我意识到我没有在调试模式下运行,这就是为什么我没有看到更好的堆栈跟踪。

最合乎逻辑的假设一定是人(好吧,我)因素。可能会放双 httpRuntimes 什么的。

所以 - 没有错误了。虽然没有解决原来的问题,在这里描述:ImageResizer restarts application pool

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-31
    • 2018-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-17
    • 2018-09-12
    相关资源
    最近更新 更多