【问题标题】:Site restart after removing folders from physical path. on IIS 10从物理路径中删除文件夹后重新启动站点。在 IIS 10 上
【发布时间】:2021-11-11 05:47:58
【问题描述】:

我们在asp.net 4.7 站点上具有删除包含静态数据(css、js)的文件夹并生成包含更新的(js、css)文件的相同文件夹的功能。使用静态数据删除文件夹后,站点重新启动。我收到此错误日志:

ApplicationEnd: ShutDownMessage: Directory rename change notification for 'D:\Projects\MySite\src\WebProject'.
WebProject dir change or directory rename
HostingEnvironment initiated shutdown
Directory rename change notification for 'D:\Projects\MySite\src\WebProject'.
WebProject dir change or directory rename
Directory rename change notification for 'D:\Projects\MySite\src\WebProject'.
WebProject dir change or directory rename
HostingEnvironment caused shutdown 
 ShutDownStack:    at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at System.Web.Hosting.HostingEnvironment.InitiateShutdownInternal()
   at System.Web.Hosting.HostingEnvironment.InitiateShutdownWithoutDemand()
   at System.Web.HttpRuntime.ShutdownAppDomain(String stackTrace)
   at System.Web.HttpRuntime.OnCriticalDirectoryChange(Object sender, FileChangeEvent e)
   at System.Web.FileChangesMonitor.OnSubdirChange(Object sender, FileChangeEvent e)
   at System.Web.DirectoryMonitor.FireNotifications()
   at System.Web.Util.WorkItem.CallCallbackWithAssert(WorkItemCallback callback)
   at System.Web.Util.WorkItem.OnQueueUserWorkItemCompletion(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

IIS(APPPool/站点)中的某些设置在删除此文件夹后不会在站点上创建重新启动。

PS。我已经在 web.config 上使用fcnMode="Single" 调查了解决方案。这不是我们的解决方案。

<httpRuntime executionTimeout="180" targetFramework="4.7.2" requestValidationMode="2.0" maxRequestLength="104857600" fcnMode="Single"/>

【问题讨论】:

    标签: asp.net .net asp.net-mvc iis iis-10


    【解决方案1】:

    这是 IIS 的正常行为。

    IIS 会在以下情况下重新启动应用程序或回收应用程序池: web.config 已编辑

    • machine.config 已编辑
    • global.asax 已编辑
    • Web 应用程序的 bin 目录或 bin 的子目录之一中的文件已更改
    • 在 Web 应用程序目录中创建、重命名或删除目录
    • 一个 ASP.NET 文件(aspx、asmx 等)被编辑(并因此重新编译)超过 20 次,在机器配置中默认设置为名为 numRecompilesBeforeApprestart 的元素
    • 通过machine.config中元素中各种属性的设置,影响worker进程本身的重启/关闭。

    您无法阻止这种行为,因为它是设计的。除非您停止删除文件夹。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-28
      • 1970-01-01
      • 1970-01-01
      • 2014-12-11
      • 2015-08-09
      • 1970-01-01
      • 1970-01-01
      • 2013-06-08
      相关资源
      最近更新 更多