Why an ASP.NET web site gets recompiled when renaming or deleting a folder inside
I develop a sim开发者_Go百科ple file manager inside an ASP.NET Web site (not web application).
I notice that every time I rename or delete a folder, the site gets recompiled - i.e. the very next web request after delete or rename operation takes considerably much time to execute.
It's only true for folders, not for files. Why does this occur?
P.S. I use WebDev server (Cassini), haven't tested in on IIS yet.
UPDATE: The same disaster happens with ASP.NET MVC Web Applications :(
UPDATE 2: Here are similar discussions:
- Storing temporary user files in ASP.NET in medium trust
- ASP.NET restarts when a folder is created, renamed or deleted
Asp.net watches the folders and then runs compilation to keep up with any changes you make. To overcome this you can use Non-updateable full precompilation, which you can read about here.
You should move the files folder outside the project structure and probably use a virtual folder in IIS to keep the paths. This should not only prevent recompilation but will also make updating the code and backing up the user files easier because they will be separated.
Where are the folders you are creating? Under App_Data?
精彩评论