473,434 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

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 FileSystemWatcher with the path set to
System.IO.Directory.GetCurrentDirectory(); and Filter set as

<<AppName>>.exe.config

Now even when

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

What I am doing incorrectly here?


Nov 17 '05 #1
1 5136
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.Directory.GetCurrentDirectory() is not the correct way to
locate the config file since the working directory of an application can be
changed at will. Use
AppDomain.CurrentDomain.SetupInformation.Configura tionFile 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 EnableRaisingEvents 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 FileSystemWatcher with the path set to
System.IO.Directory.GetCurrentDirectory(); and Filter set as

<<AppName>>.exe.config

Now even when

<<AppName>>.exe.config is changed the FileSystemWatcher 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
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...
7
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);"...
2
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...
2
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...
1
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;...
0
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...
2
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"...
7
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\"...
5
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.