Application Restart for folder deleted,added,updated

微笑、不失礼 提交于 2019-12-02 09:44:56

Your problem is because as soon as you modify, or delete any file from the applications directory, it is causing appDomain restart in order to load the changes. You got 4 options as far as I could look for:

  1. Disable directory monitoring, which you have already tried.
  2. Create a Virtual directory under the application and point this to a folder outside the application folder. Move the content that needs to be changed to this folder and can make changes.
  3. Use out of process session.
  4. Modify the registry to disable monitoring as given (Not recommended):

Registry information

loadTOCNode(3, 'resolution'); HKLM\Software\Microsoft\ASP.NET\FCNMode

The following table lists possible values for the FCNMode DWORD value and the behavior that is associated with each value.

Value Behavior Does not exist This is the default behavior. For each subdirectory, the application will create an object that will monitor the subdirectory. 0 or greater than 2 This is the default behavior. For each subdirectory, the application will create an object that will monitor the subdirectory.

1 The application will disable File Change Notifications (FCNs). [:)].

2 The application will create one object to monitor the main directory. The application will use this object to monitor each subdirectory.

The above method is take from here

Also, you can go through the following links for more information:

Well, this might be able to help with your issue, I could not find out anything about stopping the appDomain change monitoring for a specific folder. Either it would monitor the changes or not. Hope this helps. Cheers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!