473,766 Members | 2,172 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

App.config vs <<AppName>>.exe .config handling

I read and write to a config file which is the data store for this Windows
Application written in C# using VS.NET 2003 in Windows XP.

Now I want to trigger the program to read the config whenever I change it.

I use a FileSystemWatch er with the path set to
System.IO.Direc tory.GetCurrent Directory(); and Filter set as

<<AppName>>.exe .config

Now even when

<<AppName>>.exe .config is changed the FileSystemWatch er does not seem to
catch the event.

What I am doing incorrectly here?


Nov 17 '05 #1
1 5151
Could you post the code you are using for the FSW. Given the situation you
defined it would be hard to identify the problem. However a few things you
can check for are:

1) System.IO.Direc tory.GetCurrent Directory() is not the correct way to
locate the config file since the working directory of an application can be
changed at will. Use
AppDomain.Curre ntDomain.SetupI nformation.Conf igurationFile instead.
2) Did you remember to hook up events to FSW in addition to setting the
NotifyFilter property? I have found that some programs will actually delete
a file and recreate it when saving so simply watching for modification is not
always enough.
3) Did you set the EnableRaisingEv ents to true? This is what really starts
the watcher.

Posting the code will permit any potential coding errors to stand out.

Thanks,
Michael Taylor - 6/17/05

"Ranjith Venkatesh" wrote:
I read and write to a config file which is the data store for this Windows
Application written in C# using VS.NET 2003 in Windows XP.

Now I want to trigger the program to read the config whenever I change it.

I use a FileSystemWatch er with the path set to
System.IO.Direc tory.GetCurrent Directory(); and Filter set as

<<AppName>>.exe .config

Now even when

<<AppName>>.exe .config is changed the FileSystemWatch er does not seem to
catch the event.

What I am doing incorrectly here?


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
20901
by: Peter Blum | last post by:
I have built an assembly (dll) from which I expect third parties to subclass. As a result, when my assembly has a version change, it will cause any third party assembly based on it to break unless I establish a Publisher Policy file. So I have that. I have built a Windows app for the same product. This app prompts the user for a path to a third party assembly that depends on my assembly. It opens the third party assembly (Assembly.Load)...
7
3968
by: Eqbal Z | last post by:
Hi, I have the following code, and onmouseover/onmouseout etc. does not work in netscape 4.7. <div id="divUpControl"><a href="javascript:void(0);" onMouseOver="PerformScroll(-7);" onMouseOut="CeaseScroll();" class="nounderline"></a><a href="javascript:void(0);" onMouseOver="PerformScroll(7);" onMouseOut="CeaseScroll();" class="nounderline"></a></div>
2
2317
by: Gill Bates | last post by:
I'm trying to login to a banking site (https://www.providentconnection.com) using vb.net. I've tried many variations of WebClient and HttpWebRequest; none of which I've got to work. My latest version is: Dim myWebClient As New WebClient Dim nvc As New NameValueCollection nvc.Add("Login", username) nvc.Add("Password", password)
2
6439
by: Joachim Bauer | last post by:
I'm using the code below to display a menu that opens when the mouse goes over the main menu item (try it in your browser to understand the behaviour). It uses "position:absolute" and a switch between "display='none'" and "display=''". However the problem is that - in Internet Explorer 6 the dropdown (<select>...) always hides the menu
1
13648
by: hitsmly | last post by:
Hi All! I used the following code to move a <div> in IE browser to the position of the mouse when I click on a link +div tag is: <div id=fm style="position:absolute; width:100px; height:100px; background:red">moving</div> and javascript code is: ...
0
1603
by: jthomas | last post by:
Publishing with VisStudio2005 a C# windows/forms app via our IIS server. For one app, installing works fine. For another app, the <appname>.exe.config.deploy file is missing. The web admin logs onto to the IIS server, copies and renames the app.config.deploy file to <appname>.exe.config.deploy. Then users can download and install on local drive. What do I need to do so that the subject file is created in the second app? Thanks! ...
2
6316
by: gaya3 | last post by:
Hi All, is it possible to include jsp page in jspx file? I'm having as follows... in jspx file JSPX file: <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.0"> <jsp:directive.page contentType="text/html"/> <jsp:include page="http://localhost:8080/AppName/jsp/test.jsp"/>
7
4278
by: labmonkey111 | last post by:
I'm having trouble with the following code: <SCRIPT> <!-- if (navigator.appName == 'Microsoft Internet Explorer') { document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"templates/94076/menu.css\" media=\"screen, print\" />"); document.write("<script src=\"templates/94076/menu.js\" language=\"javascript\" type=\"text/javascript\"></script>"); } else { document.write("<link rel=\"stylesheet\" type=\"text/css\"...
5
1814
Claus Mygind
by: Claus Mygind | last post by:
I want to dynamically add a hidden <div> </div> to a document when loading my page. It is kind of a generic scratch pad into which I can load messages and data I may want to display to the user. I want to do it this way so I can place it in my base .js file for inclusion in all apps I write without having to reinvent the wheel each time. My problem is this; the <body> tag does not seem to pass the "id" value but rather the name of the...
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9838
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8835
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.