Deleting a directory restarts the application

I have an application with 2 directories (books and export). If we create a book or book page in the application, the directory will be added with the page identifier (this is for loading resources). If we delete the page, the page (and its directory) will be deleted from the database and file system.

However, this led to a session loss (even restarting the application). I searched for something on google and found the following link . This seems like a problem in ASP.NET 2.0 (and 3.5). Does anyone have a solution to this problem.

We are now thinking of writing a service that will clean catalogs at night. But there is no other solution for this? Oh, and placing a directory outside of a virtual directory is not an option.

+4
source share
5 answers

Oh and placing a directory outside a virtual directory is not an option.

Putting the directory outside the virtual directory is the only solution I have found (so far). What you can do is create a link (connection) in the file system so that the directory is inside the virtual directory, for example:

  • Our website (virtual directory) is located at C: \ projectX \ website
  • the data directory (where we create / delete files and folders) is located in the C: \ projectX \ data li> directory
  • then we create a link that makes the data folder accessible as C: \ projectX \ website \ data li>

The link is created using the Linkd.exe program (available in the Windows Resource Kit) with the following command:

linkd c:\projectX\website\data c:\projectX\data 

Now c: \ projectX \ website \ data is a link / connection that points to a real data directory. You can work with the link as if it were a physical directory.

eg. on your website you can access it using this code:

 Server.MapPath("~/data") 

And you can also use the Windows file explorer and browse C: \ projectX \ website \ data. It looks like a real directory.

+5
source

Try disabling file system monitoring. This will prevent your session. This article may be helpful to you.

+6
source

I had the same problem. The solution is to externalize session processing using the ASP.Net public service. The only drawback is that every object that you place in the session must be serializable, as it is transferred to and from the public service.

I currently have no way to provide sitelinks, but Google will help you now that you know what to look for.

+1
source

A fix seems to be supported, which achieves what was mentioned in the Sachin article (turn off file change notifications on the website).

For more information, check out this article on microsoft KB .

But since you mentioned in the comment that you do not have access to the server, I think this also will not help in your case.

+1
source

To store data files that are frequently updated, created and deleted, you need to use the App_Data folder in the root directory of the website. MSDN for App_Data folder:

Contains application data files including MDF files, XML files, as well as other data warehouse files. The App_Data folder is used by ASP.NET 2.0 to store a local database application that can be used to maintain membership and role information.

Also check the Q & A section to use the App_Data folder: Question about the App_Data folder

+1
source

All Articles