ASP.NET Session & Delete Folders

后端 未结 3 484
别那么骄傲
别那么骄傲 2021-01-25 01:09

I have a web app where the administrator can create news, pdf documents and other stuff in his cms panel.

The problem is when the admin delete a new or something else th

3条回答
  •  温柔的废话
    2021-01-25 01:44

    Your session is lost becasue IIS recompiles. The easiest solution in my opinion is to store your files outside the wwwroot.

    Discussed on SO: ASP.NET restarts when a folder is created, renamed or deleted

    [Update] Example: Let's stay your app is in c:\inetpub\wwwoot\virtualdir1

    You make a work directory: c:\inetpub\inetwork

    Give the proper rights (read/write/etc) to the Asp.net user of your app pool and it should all work like a charm. More info on setting the rights: What are all the user accounts for IIS/ASP.NET and how do they differ?

    Store the path to the workdirectory in your web.config (you no not want to hardcode it)

提交回复
热议问题