.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

ASP.Net - App Pool restarts because of file change notification

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :ASP.Net
Hi All,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. Can anyone tell me why this is happening -//FIX disable AppDomain restart when deleting subdirectory//This code will turn off monitoring from the root website directory.//Monitoring of Bin, App_Themes and other folders will still be operational, so updated DLLs will still auto deploy.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[] { });

View Complete Post

More Related Resource Links

How to change this code to allow more file uploads

I have a page currently setup to upload 1 image at a time, it uploaded the image, then creates a thumbnail for that image in the same directory. Client needs / wants to be able to upload a few more images at the same time. So i would like to see if i can use the existing code that works, but setup to upload a few more images and process them all to create the thumbnails. I currently have a page that allows them to upload 5 images at a time and that works fine, but its just simple uploading the images, nothing else is happening at that moment. Here is the code i am working with: protected void UploadBtn_Click(Object sender, EventArgs e) { String pth = Server.MapPath("~/gallery/homebirth/images/"); String UploadedFile = MyFile.PostedFile.FileName; int ExtractPos = UploadedFile.LastIndexOf("/") + 1; //to retrieve only Filename from the complete path String UploadedFileName = UploadedFile.Substring(ExtractPos, UploadedFile.Length - ExtractPos); // Display information about posted file. Div is invisible by default FileName.InnerHtml = UploadedFileName; MyContentType.InnerHtml = MyFile.PostedFile.ContentType; ContentLength.InnerHtml = MyFile.PostedFile.ContentLength.ToString(); //div is made visible FileDetails.Visible = true; // Save up

Change workflow rule file

Hi, I create workflow and rule base condition for that ".rule file"  . But now i have to change rule condition . when i change the condition then it return error can't  validate because of it refer previous values.   Any one can tell how change rule base conditions in workflow.

Should time date stamp on .Asmx file change when project is rebuilt?

I have a web service project. The web service is named Recalc.asmx and it has a code behind file namedRecalc.asmx.vb Now if I make a change to my web service .vb code and then recompile the project, should my Recalc.asmx filebe updated as well? In windows explorer I see that the time date stamp of my Racalc.asmx.vb file changes to the date of the last change.But the time date stamp of the Recalc.asmx file does not change? Why is that? My original thinking was that I would simply need to copy the Recalc.asmx file to the test server. But the date stillshows it's original creation date of 7/1/2010 and not the date of the last rebuild as I was hoping it would do?

How to change the split view when editing an aspx file

I've been using SPD 2010 more and more over the past few weeks.  However, when there's a navigation bar on the left, toolbox on the right, ribbon above and split view of code and design in the middle, there's just not enough room on the screen - (I have 2 LCDs at 1280x1024).  I can spread the window accross both monitors but that's not much use unless, I can change the split between code and design from horizontal to vertical. Is this possible?  Help apprieciated. Cheers, Bill

SSIS package - change Web reference's addres from Configuration file?

Greetings. The SSIS packages provide very nice options to configure them from an XML file, which allows to change credentials, database names etc w/o editing the package. This lets me, say, transfer package from one server to another or from test to production w/o any hassle - just changing the xml. Problem is, i need to acces a web service in my package, and built-in SSIS web service task is useless and just SUCKS. It fails to work even with miscrosoft's own sharepoint web service. So, i have to use scripting task. And scripting task uses "web reference" to access web services, which in turn gives no way to change it's url.  So, if i want to test and then move to production, i'll have to edit my package to change the web reference url from "testserver:5123/mywebservice" to "productionserver:81/webservices/mywebservice". And then change it again to test it again. Etc. Is there a solution to this? A way to programmatically change web reference's url from inside scripting task?

XML binding and notification on change

Dear all, I have a customer project when I need to display data into a WPF application. Data are deliver by my customer as flat XML file struture. For exemple: Information relative to a GOOD will be store in a GOOD.XML file Information relative to a CONTACT will be store in a CONTACT.XML file and exmaple of this structure is as follow : <GOODS> <GOOD> <CATEGORIE>APPARTEMENT</CATEGORIE> <NB_PIECES>3</NB_PIECES> <NB_CHAMBRES>2</NB_CHAMBRES> <SURF_HAB>60</SURF_HAB> <SURF_CARREZ>60,6</SURF_CARREZ> <SURF_SEJOUR>21</SURF_SEJOUR> <SURF_TERRAIN>0</SURF_TERRAIN> <ETAGE>0</ETAGE> <CODE_ETAGE>RJ</CODE_ETAGE> <NB_ETAGES>4</NB_ETAGES> <ANNEE_CONS>1996</ANNEE_CONS> <CUISINE>AMERICAINE</CUISINE> </GOOD> </GOODs> So the file avove will be sen from my customer app on a network drive. then I will read that file and bind my applicaction against. If my customer provide a file update, he will drop the new file at same network location and my application should read new data . The number of file extracted will be around 40 . Each file represent a separate object My questions are : 1- At first I was planning to build a local database as SQL express based on those file and work on the db but now I wonder if I should go to that

how to change button backcolor property on a form from a class file


Hello friends,

I am having a problem of updating the main form button backcolor property from another class. I have attahced the code. Please tell how can i rectify this problem.

PopUp is another class, in which i want that when ToolStripDropDown closes it change the form button BackColor from Orange to WhiteSmoke.


public partial class PopUp : ToolStripDropDown


        public PopUp()





        protected override void OnClosed(ToolStripDropDownClosedEventArgs e)


               Form1 f1 = new Form1();

              // f1._pushed = false;

       f1.Controls["button1"].BackColor = Color.WhiteSmoke;





It seems that this line works, i checked it using MessageBox it changes the backcolor property but it does not updated to the form displayed on the screen. 

Can anyone help me

Manual change to "applicationSettings" in app.config file are not read by the application.



Okay...This Application Settings stuff is driving me nuts.  Something conseptually so simple should not be this hard to get working.

Here is my

I have a .NET 4 application in which I generated a web reference from a web service wsdl.

I see that it creates an endpoint property in the app.config file which corresponds to a settings class that is autogenerated.    I compile my release code and copy the executable and config file to a local drive.

By default, the url points to the endpoint that was added by the designer.

Now, I want to change my application configuration to point to the production version the the webservice.

To do this I thought all I had to do was change the value in the app.config file.  However, the application never reads from the config, it's always taking the default setting compiled into the settings class.  I'm at a loss as to why this is happening. 

I have search through this forum and there are so many different posts on application settings but all I want to do is change the config file manually without having to recompile.   I'm not doing any runtime settings modifications. 

What if down the line we change the alias to the web service hosting the service.  I can't imagine Microsoft really expects us to have to rec

When i export a MS Excel file generated By SSRS 2008 i'm not able to change the sheet name (Sheet 1

When i export a MS Excel file generated By SSRS 2008 i'm not able to change the sheet name (Sheet 1,Sheet 2,Sheet 3) dynamically.So Please try to give me a solution.

When i export a MS Excel file generated By SSRS 2008 i'm not able to change the sheet name (Sheet 1



When i export a MS Excel file generated By SSRS 2008 i'm not able to change the sheet name (Sheet 1,Sheet 2,Sheet 3) dyanamically.Sp Please try to give me a solution.

clustered node change notification


Hello Friends,


I need a sql server script for my notification for the following.

I have node 1 and node 2 in my clustered environment.


Instances 1 and 2 usually runs on node 1. Instance 2 usually on node 2.


Sometimes they switch without notification. I need to know when they switch. Because I copy files from instances.


Need to know only what instance changed from which node and vice versa.


Any ideas and answers would be greatly appreciated.



Node Change Notification


Hello Friends/Colleagues,


I have 2 nodes active/active with 3 virtual instances.

2 instances on node 1 and 3d instance on node 2.


Sometimes they automatically change from node 1 to node 2.

Is there any way that I get some notification regarding the instance that have changed from one node to another?


I found following may be probable solution:

EXEC master..xp_cmdshell 'cluster resource "SQL Server (Instance Name)"'

Result: Instance Name, Node Name

Put results into table..........Again run the command.....compare.......too much stuff.....

If someone knows the easy path to this.......


How could I get the information that has been changed?


Your help would be really great!



On Change:Prevent Evaluation fails with error Could not load file or assembly 'Microsoft.SqlServer.


Hi All,

I am facing a strange issue with Policy Based Management. Exact problem is as below

SQL Setups


I have Lenovo laptop having 3 SQL instances installed on it.

SQL Server 2005 (x86) Developer Edition 9.00.4053  -- Named Instance : SQL2K5

SQL Server 2008 (x86) Developer Edition 10.0.1600.22 -- Named Instance : SQL2K8

SQL Server 2008 R2 (x86) Developer Edition 10.50.1600.1 -- Named Instance : SQL2K8R2


I configured SQL2K8R2 instance as a Centralized Server and registed SQL2K8 & SQL2K5 under this. I configured a new condition by using facet: MULTIPART NAME. As per this condition Table Should start with TEST_ in database TEST . Evaluation Mode set to              On Change: Prevent. Idea is if some one logs to database TEST and tries to create table with name other then starting with TEST_ then it should fail.

I Imported this policy on registered servers thru Centralized Management Server Action, as expected policy got configured on Registred SQL2K8 instance

how to change the default log file location?


I recently install SQL2005 on my win 2003 server. I have 3 drives (C, D, E).  The sql is installed on D. 

When I install SharePoint, it create the database for me.  However, both data & log files are default to D:\Program files......

As advised, I should separate data & log files into different drives.  How can I set the default data file to D and log file to E?  Can I detach the model database and move the current ldf file to E.  Then update the new location when I reattach the model database?  Will this change my future default log file location?   Is this save to do it this way? or I shouldn't touch the model database.  Instead, do a manual change after a new database is created?! 



How can I change the CSS file used in Master Page dynamically?


I am thinking that it would be better to use multipe CSS files and change them within the master page dynamically than it would be to use multiple master pages (basically one master page for each page, which defeats the purpose of the master page).

However, I do not know how to make a change to the master page before a standard apsx page that is derived from it is loaded.

SSIS Script Componet to change Flat File LF to CR LF



I have a corrupt Flat File and I need to write a SSIS Script Component to Replace LF to CR LF in my flat file.

Any idea how to do it?



How to change the service application's application pool


Hi all,

I have a small 2010 farm (DB server/app server/WFE) implemented on vmware virtualization and I'm having CPU performance issues in the App server (quad core, 8 GB used by 50 people...). While I was creating the service applications I gave each a separate application pool since that seemed the best practice to follow, but now have more than 10 w3wp processes consuming cpu and memory. After some research I found that for performance purposes one should minimize the number of app pools, so now I want to change them and remove a few.

Any ideias how one can do it? Is there a method? It's not something one can use the UI directly to do....


Thanks in advance

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend