Session - Why Does Application Recycle When Delete A Folder
Sep 27, 2010
I have a Silverlight application using a WCF service hosted in IIS. I make use of some aspects of ASP.NET. I have the following folder structure for my application:
inetput
wwwroot
myapp
reports
{user-guid-folders}
report1.pdf
report2.pdf
App_Data (folder)
bin (folder)
Client_Bin (folder)
(various .aspx files, plus web.config, etc.)
The application dynamically generates reports and puts them in a folder with a GUID for the name which is unique to the user. This all works fine. However, when the user logs out I was cleaning up and deleting the PDF files in their folder, then deleting their GUID folder.
Deleting the files works fine, but if I delete the folder, the application recycles (which then removes all other users' sessions - I get a Session_OnEnd event for every user's session, and an Application_OnEnd event. The next user request causes the whole application to restart. So, while I can fix this by not deleting the GUID folder (which my application itself created), what is the reason for this? Is there any way I can prevent this from happening?
All we have a global ships position tracking website which runs smoothly until IIS application pool recycles.When there is workerprocess recycling looks like session state expires as a result i loose all session data and when customer clicks refresh button he is redirected to login page.
In web.config Session state mode is set to InProc so i changed it to State Server but to my luck i have MAP object which is not serialiazable which is causing the maps from not appearing on the website.I tried adding serializable attribute to the object class but still not succesfull.Our website is accessed by our customers whose count is more than 1000.
Changing the session state mode from InProc to StateServer can really slow down the response time so Is it good to go further fix the serailizable issues and move to state server?.
Is there any way I can retain my session data when application pool recyles?..
Stopping Application pool from recycling may not be a good idea considering health factor of web server.
I use the simple code in onunload's body method like this:
<body onunload="closeIt()"> ... </body>
The closeIt method is call a server method, like this:
function closeIt () { $.ajax({ type: "POST", url: "mypage.aspx/myFunc", data: '{}', contentType: "application/json; charset=utf-8", dataType: "json", //async: false, success: function(response){}, failure: function(response) { alert(response.d); } }); } I delete a folder in temp directory in myFunc method. The folder's name is the same of value in Session["id"], like this: string id = Session["id"]; string temp = "~/temp" + id; temp = Server.MapPath(temp); DirectoryInfo dr = new DirectoryInfo(temp); Directory.Delete(dr.FullName);
When the last code( Directory.Delete(dr.FullName) ) is run, the all session in project is changed to null. If i disable the last code( //Directory.Delete(dr.FullName) ) every thing work properly(all session have the value). Why when i enable the last code, all session are null? What's the problem and how can i solve it?
have been using the Publish Web Site option VS 2005, and all of a sudden it quick working correctly and do not get an error message. Also, compiling the web site does not take as long as it did before. Now Pubish Web site only puts the bin folder and PrecompileApp.config file in the C:InetpubwwwrootOIAEmailMaint. Because I am working and testing this website sometimes I delete any previous files that was in the folder C:InetpubwwwrootOIAEmailMaint before Publish Web Site. I did notice when I was looking at the files I delete in the Recycle Bin that a app_offline.htm. Apparently I changed some kind of option by accident by I do not have a clue what.
I've got an ASP.NET MVC app running under IIS7. It's using the default in-proc session management, which, according to all that I read, should lose the users' session after an app pool recycle.It doesn't seem to be losing it though. Even an IIS reset doesn't lose the session.Has something changed in IIS7 that keeps the session alive?
I have made changes to my global.asax file so i want to recycle my web application to make the changes work. How to safely recycle my asp.net web application in production server?
My application is running in a shared hosting environment. I do have a dedicated App Pool for my app. I've been doing some testing with 1st visits and precompile performance and have been tracking when my application starts up and shuts down.
In my Global.asax I have some logging code in Application_Start and Application_End. I can see from my logs generally when the application is idle and shuts down, then someone visits and it starts back up.
But, I also see cases where a shutdown is logged and then followed by another shutdown about 13 minutes later; without a startup in the middle.
I also see instances where there are two Startups in a row. I'm guessing these might be a recycle, but why wouldn't there be a shutdown log entry?
What I'd really like to know if there is a better way to track when my application starts, when it shuts down and if it is shutdown due to an idle pool, or from a recycle. I don't have access to the Windows Event Log so I need to do this from my app if possible.
I have a number of ASP.NET (4.0) web applications that appear to leak (a small amount) of memory during each request. It is such a small amount, that for most use-cases, it will not grow to become a problem for weeks or even months at a time. I generally try to be good with closing any connections managed by the application, avoiding state-variables (or instance variables for my singleton), etc. My question is this - is this normal behavior for ASP.NET applications? I had turned off the default (IIS 7) behavior of recycling the app pool after 20 minutes of being idle. I do this since the application takes a few minutes to build its internal cache, and I want to avoid negatively impacting the user experience (and having them wait for the application to start when they issue the request).
I'd like to describe strange issue I've noticed while analyzing my asp.net application in production and ask for some advice or opinion on the following matter.Application usually runs with some 80-90 MB of memory footprint. This seems stable since no memory leaks have been detected so far - no slight increase in memory usage over time. Yet, problem occurs when application pool recycles (I'm using shared hosting and judging by logs it occurs either when app is idle for 20 mins or every ~30 hours - something like that). The issue is that used memory almost doubles for some period on recycle - it goes to some 160-170 MBs without any explanation. This is confusing, since it is common claim that recycling should purge the memory and all other resources - at least I get it that way. System holds this amount of memory for some 7-8 hours and then memory usage drops to it's usual level of 90-100 MB, again, with no apparent reason (at least not know to me).
my web applications app pool configuration is PeriodicRestartMemory : 512000 PeriodicRestartPrivateMemory : 196608
although the virtual memory limit is higher than private memory, app pool is recycled with virtual memory limits exceeded errors in the event log (instead of private memory).
what is the reason for this? how could it exceed virtual memory limits before exceeding private memory limits? it seems that systems other allocations in virtual memory cause limits exceeded before applications private allocations exceed the limits, but what are those allocations of the system? or what is the root cause of this.
My WCF Service isnt restarting after the app pool recycles. I have no control over how often the pool is recycled (shared hosting) .How do I get the wcf service to restart on pool-recycle ?
I have a CentOS 5.x server running Mono 2.8.1 and mod_mono 2.8 with apache2.
Every time I deploy a site from visual studio 2010 to my server by ftp, and navigate to the site, I get a 404 not found error page.
Sites in other subdomains (virtual hosts) are not affected.
Performing a restart of httpd using /etc/init.d/httpd restart fixes the problem, and I can view my ASP site again. Obviously restarting the entire httpd process is less than adequate.
My guess is that this is similar to application domains in IIS. Is there a way to 'recycle' and app domain in mod_mono? Can I set this to happen on deployment?
Using "Enable Delete" from Gridview control, I can delete (besides, update, sort, paging, etc) data from the database (this is done automatically). However, how can I delete the actual image that resides in my image folder (i.e. from "pix" folder )? What is the best way to delete image? If using code behind, how? Please write a full code for me. Here is my source code.
I have an application in which the admin can upload files and the visitors of a website can download those files. I want to add an option that will allow admin to delete unwanted files from that folder how can this be done usin asp.net(vb).
I retrieve the image and save in a folder but i don't how to delete the image from the folder which have been save.. I used vb.net and sql server 2005.
I am using grid view and on grid delete image click i remove product but i also want to remove image phisically from the folder.i have deleted logically but i need code to delete from folder ?
A blog user uploads pictures to a picture folder on the web server. Whenever the user deletes a post, any picture associated with the deleted post must also be deleted. Every post record is saved with its picture jpg name on the backend.
On our website, we have an application within our website. The following is the folder structure:
website1 (main website) bin directory1 website2(an application) bin directory2 webconfig2 webconfig1
There are other folders under each of the main folders which contain other pages, images, etc.
We're trying to upgrade the website and are encountering some difficulties. We want to remove the website2 from the main website to see it it's causing the problem.
However, we cannot remove the bin folder and so we can't remove the website2 folder. We've been able to delete everything but the bin folder itself. We've tried downing the website and the application pool but we still get the 'access denied' error message.
I want to delete a folder in asp.netTo create the folder Directory.CreateDirectory(Path.Combine(Server.MapPath("~/Docs/"), idtxt.Text)); But how I can delete it?
I am creating an image converter which convert an image from one format into another format,what i am doing is i am calling a dll file(.cs file which is doing the conversion) from my program but i am facing a problem in that when i call the dll file it creates a unique guid for every image and then process it and convert that to another format and provide the result back to the calling class which saves the file by whatever name i want to save and then delete the guid file which were created in the root folder,everything is working fine but when i delete the file containing GUID it gives me an error saying that the file is already used by another process,i have checked everything many times.