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?

View 1 Replies


Similar Messages:

State Management :: Session State Expiration After Application Pool Recycle?

Nov 1, 2010

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.

View 8 Replies

Web Forms :: Why All Session Is Changed To Null When Delete A Folder

Mar 3, 2011

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?

View 7 Replies

Visual Studio :: The Files Delete In The Recycle Bin That A App_offline.htm?

Mar 2, 2011

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.

View 1 Replies

IIS7 ASP.NET In-proc Session NOT Being Lost After App Recycle?

Aug 23, 2010

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?

View 1 Replies

Recycle Web Application In Production Server?

Sep 1, 2010

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?

View 3 Replies

Log IIS Application Pool Startup / Shutdown And Recycle?

Dec 9, 2010

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.

View 1 Replies

Iis7 - Should Set .NET Application Pool To Auto-recycle

Mar 3, 2011

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).

View 1 Replies

.net - Memory Increase On Application Pool Recycle?

Dec 14, 2010

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).

View 1 Replies

Memory Limits And Application Pool Recycle?

Jun 22, 2010

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.

View 1 Replies

Is It Possible To Recycle IIS Application Pools Without Losing User Sessions

Nov 25, 2010

We're currently deploying code to live pretty reguarly at the moment, but the down side is destroying user session data.

Is there a way of being able to recycle IIS without loosing session data, or is persisiting session state in SQL server or alike the only way?

View 2 Replies

ASMX :: WCF Service Is Not Restarting After Application Pool Recycle?

Nov 18, 2010

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 ?

View 1 Replies

Recycle Application Mod_Mono 2.8 / Getting A 404 Not Found Error Page?

Dec 14, 2010

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?

View 2 Replies

Forms Data Controls :: Delete Images From Folder Using Gridview Delete Link?

Feb 3, 2010

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.

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="photoID"

View 12 Replies

IIS Configuration :: Membership Forms Authentication Cookie Clears On Application Pool Recycle

Jan 28, 2013

I use Form Based Authentication in my siteIn my login page I have:

FormsAuthentication.SetAuthCookie(user.userName, true)

View 1 Replies

State Management :: Which Place(exact Folder) The Session & Session Id Will Be Stored

May 3, 2010

which place(exact folder) the session & session id will be stored?

View 8 Replies

Configuration :: Adding A Virtual Folder To The Application Folder?

Sep 21, 2010

I have an asp page that needs to download files off of a virtual directory.

I wanted to add the virtual directory to the Visual studio app.

View 2 Replies

How To Delete Files From Folder Using .net

Jan 22, 2011

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).

View 16 Replies

Delete The Image From The Folder?

Mar 9, 2010

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.

View 5 Replies

Web Forms :: How To Delete Images From Folder

Mar 22, 2010

i want to delete images from folder dynamically,but it didnt delete

someone told me that i have to add command argument then the file name in it

but i dont know why i need the file and where can i put the file(in any folder)?

thats my code

[Code]....

and thats my CS

[Code]....

View 4 Replies

Delete Images From Folder Physically In Vb.net?

Oct 9, 2010

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 ?

VB.NET

View 6 Replies

How To Delete A Single File From Web Folder

Mar 27, 2010

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.

View 7 Replies

Configuration :: Cannot Delete A Folder In A Website

Dec 13, 2010

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.

View 2 Replies

Web Forms :: Delete Folder Or Directory Using C#?

Apr 3, 2013

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?

View 1 Replies

Web Forms :: How To Delete A File From Bin Folder

Aug 23, 2013

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.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved