C# - Web Application Restarts When Deleting Directory?

Jun 30, 2010

I have some code in my logout routine that deletes some temporary session files when the user logs out or when the session expires. Deleting these folders causes my web app to restart. It does not error out or throws an exception it just restarts!

View 1 Replies


Similar Messages:

When Encountering An Access Violation - W3wp.exe Crashes And Restarts Repeatedly Until The Application Pool Is Stopped

Feb 8, 2011

I have a CLR 4 WCF service hosted in IIS 7.5 (Windows Server 2008 R2), using the WebHttp binding (with [WebGet]). The service calls into an unmanaged component implemented in C++ (Visual Studio 2010). I deliberately added an access violation inside the unmanaged component (by calling delete on a pointer repeatedly, calling methods through a deleted pointer, etc.) to test dump file generation settings. The access violation crashes the w3wp.exe process, which is not surprising considering "Corrupted State Exceptions" in CLR 4. However, when the process restarts (due to warmup and always-on settings in IIS), the same request seems to be replayed to the service so that it crashes the w3wp.exe process again. After a few times (governed by the "max failures" application pool setting) the application pool is stopped.

I'm using the browser as the test client, and while the restart sequence is underway the request is still in flight. When the application pool is stopped, the request returns with 503 Service Unavailable. I can work around the problem by placing try...catch block around the code and using the [HandleProcessCorruptedStateExceptions] attribute. When I do that, the w3wp.exe process does not crash. However, this is not the desired behavior -- I want the process to crash (an access violation or a memory corruption is bad enough) but I want it to restart into a clean state and not have the request replayed. I was not able to reproduce the problem using the BasicHttp binding.

View 1 Replies

Web Forms :: Deleting Image From Directory?

Oct 6, 2010

Deleting image from directory?

View 3 Replies

How To Prevent AppDomain Recycles In IIS 7.0 When Deleting A Sub Directory

Jan 20, 2010

I have an asp.net web application that allows users to upload files to an 'uploads' directory that is located in the same virtual directory as the web app. Each uploaded file goes into a temporary sub directory that is named after the user's session id. Once I'm finished with the files, I delete the temp sub directory. The only problem is that when a sub directory is deleted, the AppDomain gets recycled and kills all user sessions (using inproc session state). The culprit appears to be a FileChangesMonitor that watches for changes in all sub directories in the application.

The following code works great in IIS 6.0 running on Windows Server 2003 to disable the FileChangesMonitor for sub directories, but for some reason it's not working in IIS 7.0 on Windows Server 2008:

System.Reflection.PropertyInfo p = typeof(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
object o = p.GetValue(null, null);
System.Reflection.FieldInfo f = o.GetType().GetField("_dirMonSubdirs", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.IgnoreCase);
object monitor = f.GetValue(o);
System.Reflection.MethodInfo m = monitor.GetType().GetMethod("StopMonitoring", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
m.Invoke(monitor, new object[] { });

I found another solution that disables the FileChangesMonitor altogether here. But this is not the ideal solution as I still want to monitor all other files except for the temp sub directories in the 'uploads' directory. Why does this work in IIS 6.0 and not in IIS 7.0? In IIS 7.0 can you specify sub directories in a virtual folder you want to disable recycling on? Is there another way to do this without using reflection?

View 2 Replies

Forms Data Controls :: Gridview And Deleting / Editing Files In Virtual Directory?

Feb 26, 2010

COMPLETE NOOB, dont know anything.. I have a Virtual directory ~/ClubInfoFiles that i upload some files too using a uploader i made. I might want to change the uploader i made to be able to change to a subdirectory or something so i can upload all files into one folder but different subdirectorys. the uploader i would like to be able to have a dropdown menu of all the subdirectorys within "ClubInfoFiles" say i has subfolders : Minutes, Flight Plans, Maintence Records, etc... but i would also like a field to where i can create a new subdirectory and have it automaticly update the dropdown. i want to list those files in gridview and have a link to dowload/open and dellete the files. i have found some code that gets close but it uses Auto Generate columns. really i dont need all that jazz, just the Name, File extention, and hyperlink the file for download/view. i would like to be able to delete and possible upload using the gridview... is this to much for a noob?

[Code]....

[Code]....

[Code]....

View 3 Replies

AJAX :: App Pool Restarts Because Of File Change Notification?

Aug 31, 2010

IIS restarts everytime i delete a file. I came across this code which was supposed to fic the problem but the line f.GetValue(..) in last but one line returns null.

[Code]....

View 2 Replies

Security :: Deleting All Users In Application?

Jul 18, 2010

Though I have not tried it but i guess asp.net allows us to delete all the users in our application. What i mean is if it allows us to delete all the users, then at 1 point my application might become defunct or I will have to go back into WAT.

In my application only users in admin role are authorised to create new user, but when all user can be deleted, what will hpapen?

And if a user is logged in and deletes himself, he still remains logged in though with restricted access untill manually logout is not pressed.

Do I have to take care of all this code manually?

View 7 Replies

Active Directory/LDAP :: Service Reposding Slow In One Application And Fast In Another Application

Jun 16, 2010

I have two applications(A,B) both are developed in .NET3.5 and used LDAP services.Application-A in one screen we are fetching users with role "project Leads" and it is taking 10 min time

Application-B in login screen we are checking user is authenticated or not and it is taking 20 sec

Both the applications are using the same service then way there is a time span problem. Please suggest me what can I do to improve performance of application A?

View 3 Replies

Active Directory/LDAP :: How To Add A Field That Add Active Directory User In Web Application

Sep 30, 2010

I like to add a field that add active directory user in ASP.NET Web Application .

View 1 Replies

C# - Deleting From Repeater Item - Erroneous Deleting?

Sep 27, 2010

I have a repeater which binds a set of data. Within this repeater is a column with various controls for updating, deleting, etc. These are image buttons which fire an onclick event such as "DeleteRecord". All this does is fire a stored procedure, passing in the ID of the record to delete from the CommandArgument of the object.

This works wonderfully... except for one rather huge problem. Once you delete a record, if you refresh the page, the record where the first deleted record used to be gets deleted. For instance... if I have 4 records

1 Record1
2 Record2
3 Record3
4 Record4

and I delete record 2... The page reloads with (which is fine):

1 Record1
3 Record3
4 Record4

...if I then hit refresh...

1 Record1
4 Record4

I assume this is because the erroneously deleted object (record3) is now in the same hierarchical place as the old object used to be and .net therefore doesn't know the difference, the page refreshes and fires the onlick event, grabbing out the command argument of the new object and deletes based on the ID as obtained from the commandargument of the new object. This is obviously a huge problem, if a client did this it would destroy data erroneously and I'm at a loss here. Is there any way to stop this from happening? I'm not sure if there is a better way to go about doing things or not. If there isn't, I need some sort of way to tell the page not to execute the event or to cross reference the ID of the object that is intended for deletion against the object itself...

Code below for convenience...

EDIT Wrapped a LinkButton around it because I have some jquery code in here as well which stops the page execution to wait for user confirmation. Pressing "ok" continues page execution.

<asp:LinkButton ID="oDeleteLink" CssClass="oDeleteIcon" CommandName="Delete" CommandArgument='<%# Eval("iAccountID") %>' runat="server">
<asp:ImageButton ImageUrl="/files/system/icons/trash-steel-16.png" ToolTip="Delete This Account" AlternateText="Delete" ID="oDeleteIcon" runat="server" />
</asp:LinkButton>
protected void oAccounts_ItemCommand(Object Sender, RepeaterCommandEventArgs e) {
if (e.CommandName == "Delete") {
int ID = e.CommandArgument.ToString().Numeric();
db.SPs.SpDeleteAccount(ID).Execute();
UI.Confirm(uiBroadcast, "Account has been deleted", "300px");
BindAccounts();
}
}

View 2 Replies

A Virtual Directory Not Being Configured As An Application In IIS

Jan 13, 2010

I've below error message:

***********************************

Error 1 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. C:PdfViewerPdfTestSiteWeb.Config 28

***********************************
When I double click the error it goes to Web.Config file to tag:

<authentication
mode="Windows"/>

The application name in IIS is PdfViewer

View 2 Replies

C# - Publish ASPX To Sub Directory Of Application?

Jun 30, 2010

I have published an asp.net application to a sub directory of my IIS application. I know that the web.config must exist at the root for several of the properties to work. So I have moved my web.config to the root of the application. I get the following error:

Could not load type 'ProjectName.myTypeName'.

I suspect that not having the web.config in the same directory as this aspx file is causing the issue. How do I config this so that my web.config can live in the root while the aspx file lives where I need it to?

View 3 Replies

How To Rewrite To A Virtual Directory With A Different Application

May 4, 2010

I have a CMS application that manages multiple websites, today whenever i change the codebehind of one of these websites - i have to rebuild the dll for all websites, deploy it - this disconnects all current sessions and is really bad.

The iis is configured to listen to all domain requests, if the request is to one of the websites' domain , the application rewrites it, or example, if someone requests for http://www.example.com, and example.com is configured in the application to be website 12, it is rewritten to http://www.example.com/websites/12/default.aspx.

This is done for all websites.

We want to seperate the dlls of the websites from each other, and from the main CMS, we have a virtual directory to each websites, but when trying to rewrite to it, we discover that IIS support this (we get an "Could not load type '_12._Default'". error).

How can we perform this rewrite so it does rewrite to virtual directories, or if anyone has any other solution for the initial dll seperation problem.

View 2 Replies

Syncing Active Directory With Application?

Dec 15, 2010

I've inherited an application with its own user database and login authentication scheme which cannot be replaced.There is now a need to integrate with Active Directory.I've implemented mixed mode (forms and AD) authentication, where I'm having issues is keeping the users in syncI've added a column to our user database for the active directory account name. The admin will need to create a user in AD, Create it in our application, and then in our application, select the AD user that matches..This feels dirty and naive, what better ways are there to do this.

View 5 Replies

Configuration :: Configure Directory As An Application?

Sep 22, 2010

I'm getting this error when I was uploaded my files to online server.

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

View 2 Replies

Web Forms :: A Virtual Directory Not Being Configured As An Application In IIS

Oct 13, 2010

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. this error occured in web.config file.

<system.web>

<sessionState mode="InProc" cookieless="false" timeout="30"/>

<authentication mode="Forms"/>
<compilation debug="true">

View 3 Replies

Remove The App_offline.htm From The Application Root Directory?

Sep 18, 2010

I get the message "This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory. "

However, this is no app_offline.htm file in the root directory. Where in the heck is it?

I am looking in the Solution Explorer, and I also looed in Windows Explorer . . . not a sign of it. ?

View 4 Replies

How To Access A WCF Service In A Virtual Directory In MVC Application

Feb 1, 2011

I am trying to deploy an asp.net MVC and a WCF service in a single website. The root site is the MVC application and i am going to run the WCF as a virtual directory of the site. However the service cant be accessed since the routing of the MVC would not relay the request to the service. It would say "Page not Found".

http://PC:9000 <- root of mvc application

I have a virtual directory for the wcf named "wcf",

http://pc:9000/wcf/service.svc <- should have accessed the service but routes of the mvc intervened and will display page not found.

how to make this work? How would i ignore the routing if the call is for the service?

View 2 Replies

Get User's Full Name From Active Directory In Web Application?

Nov 28, 2010

I am trying to get the full name of a given user from active directory. This code works on my PC but when I put it on the server it throws exception:

The network path was not found.

The code is:

DirectoryEntry obDirEntry = null;
try
{
obDirEntry = new DirectoryEntry("WinNT://" + "domain" + "/" + Environment.UserName);
System.DirectoryServices.PropertyCollection coll = obDirEntry.Properties;
object obVal = coll["FullName"].Value;
Response.Write(obVal);
}
catch (Exception ex)
{
Response.Write(ex.Message);
}

how to fix so it would work on the server also? Or maybe some other way I can get the full name of a given user name? Do I need to use LDAP instead somehow?

View 1 Replies

.net - Override IIS Virtual Directory/Url In Web Application Project?

Mar 2, 2011

I have a team currently working on a Web Application project, we want to be able to run the project through our local IIS web servers and let each dev map it to whatever virtual directory they like.Currently every time we check in we are stomping on each others virtual dir settings in th cs proj file.I know we could just agree on a virtual directory and stick with it but that does not solve another problem I am having with this where I actually keep multiple copies of the repository on my machine and want to be able to map each to a separate virtual directory.

So the result we are looking for would look like this:Dev1 has a checkout at say c:/dev/Webapp mapped to a virtual dir on their local IIS say localhost/WebAppThen Dev 2 has a checkout at say c:/workspace1/WebApp mapped to a virtual dir say localhost/workspace1/MyWebAppAND Dev 2 has a checkout at say c:/workspace2/WebApp mapped to a virtual dir say localhost/workspace2/WebAppPS. The reason Dev 2 has two checkout is because he uses on for active dev work and the other for merging between branches.

View 4 Replies

C# - Get LastActivityDate When Using Active Directory Setup In A .net Application?

Apr 23, 2010

I have a requirement to show a list of all users along with the Last Activity Date. The application is .Net based.

I found the MemberShip class provides the Last Activity date. However, this does not work when the MemberShip provider is ActiveDirectory Link to MSDN page because the ActiveDirectoryMemberShipUser does not implement the LastActivityDate property.

Is there any workaround or other way, I can get the LastActivityDate of the user in the application.

View 1 Replies

Web Forms :: How To Convert Virtual Directory In The Application

Jun 11, 2012

how to convert virtual directory in the application in xp????

View 1 Replies

VS 2013 - Virtual Directory Not Being Configured As Application In IIS

Dec 9, 2015

According to this MSDN blog, it should be quite straightforward to add health monitoring to my website by adding this:

Code:
<healthMonitoring>
<rules>
<add name="Application Events"
eventName="Application Lifetime Events"
provider="EventLogProvider"
profile="Default"
minInterval="00:01:00" />
</rules>
</healthMonitoring>

to the <system.web> section of my web.config. However, when I do that I get this error: It is an error to use a section registered as allow Definition=' MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

what else I might need to tweak? Is the comment about it not being configured as an application likely? It's a struggle to get permission to check the IIS settings, and the website works correctly without this section in the config.

View 2 Replies

This Error Can Be Caused By A Virtual Directory Not Being Configured As An Application In IIS

Dec 2, 2010

i have developed website in MS framework 2.0 using Visual Studio 2005 Sql Server 2005 and Crystal Report 2008 (Version 12.0.0.549) due to some problem i have formated my pc and reinstalled Visual Studio 2005 Sql Server 2005 and Crystal Report 2008 sp3 (Upper version)on my pc now my website project running on IIS 5. is fine but when i open my website on visual studio 2005 it shows an error as below ...................

101 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

D:NayanAdvance_TestAdvancesystemweb.con

it need registry i think so, Now i did't get this error exactly

View 5 Replies

Configuration :: Accessing An IIS Application Directory From Visual Studio?

Oct 10, 2010

I have created an application directory in IIS and specified its physical location in my harddrive. im trying to create a new Http-based website in Visual Studio 2008 but im unable to assign it to that application directory because in the "choose a location" dialog I cant view that application directory under my default web site directory. can someone tell me why? is it because visual studio doesnt have permission to access it. if that is the case how can I edit the permissions of that application directory in IIS so I can allow visual studio to have access to it?

View 1 Replies







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