473,382 Members | 1,165 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,382 software developers and data experts.

System.Diagnostics.Switch problems

Has anyone tried to utilize this class? Unfortunately, the MSDN
documentation is pretty weak for this class and the examples they provide
are pretty lame.

I created a class that derives from System.Diagnostics.Switch and it
successfully retrieves the correct value from the configuration file.
According to the documentation, the class is supposed to listen for file
changes and will automatically update the in-memory values when the
configuration file gets updated; however, I haven't been able to get this to
work... my derived class instance always returns the original value
initially read through the configuration file.

Any suggestions on how to use the Switch class without hacking at it (by
this I mean doing my own file listening and reparsing the file when it gets
updated).

Thanks,
-Mike
Nov 16 '05 #1
2 2309
Michael,

I have reviewed the MSDN docs on the Switch class and I cannot find anything
saying that this class is capable of automatic monitoring of the changes to
the configuration file. Could you post a link or at least a topic name?

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Michael Riggio" <mi*****************@spam.unisys.spam.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Has anyone tried to utilize this class? Unfortunately, the MSDN
documentation is pretty weak for this class and the examples they provide
are pretty lame.

I created a class that derives from System.Diagnostics.Switch and it
successfully retrieves the correct value from the configuration file.
According to the documentation, the class is supposed to listen for file
changes and will automatically update the in-memory values when the
configuration file gets updated; however, I haven't been able to get this to work... my derived class instance always returns the original value
initially read through the configuration file.

Any suggestions on how to use the Switch class without hacking at it (by
this I mean doing my own file listening and reparsing the file when it gets updated).

Thanks,
-Mike


Nov 16 '05 #2
Here's the link:
http://msdn.microsoft.com/library/en...asp?frame=true

It certainly sounds like it will automagically update when the file gets
changed.

Thanks,
-Mike

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:ub**************@TK2MSFTNGP09.phx.gbl...
Michael,

I have reviewed the MSDN docs on the Switch class and I cannot find anything saying that this class is capable of automatic monitoring of the changes to the configuration file. Could you post a link or at least a topic name?

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Michael Riggio" <mi*****************@spam.unisys.spam.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
Has anyone tried to utilize this class? Unfortunately, the MSDN
documentation is pretty weak for this class and the examples they provide are pretty lame.

I created a class that derives from System.Diagnostics.Switch and it
successfully retrieves the correct value from the configuration file.
According to the documentation, the class is supposed to listen for file
changes and will automatically update the in-memory values when the
configuration file gets updated; however, I haven't been able to get
this to
work... my derived class instance always returns the original value
initially read through the configuration file.

Any suggestions on how to use the Switch class without hacking at it (by
this I mean doing my own file listening and reparsing the file when it

gets
updated).

Thanks,
-Mike

Nov 16 '05 #3

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

Similar topics

2
by: cody | last post by:
System.Diagnostics.Debug.Assert(); Hello??? A language should encourage programmers to heavily use the assert-feature, since it improves safety, stability, readability and maintainability of...
2
by: Joey Mack | last post by:
Greetings. I am trying to use the System.Diagnostics.Process class to perform some actions through the Windows command line. The applicable code appears below. The code builds the follow command...
1
by: Patrick | last post by:
When Tracing in ASP.NET, the IIS process (on IIs5.1) is locking on the Trace file, and I can't read the trace file without restarting the IIS: Even the following does NOT work (how could I fix...
11
by: Nurit N | last post by:
This is the third newsgroup that I'm posting my problem. I'm sorry for the multiple posts but the matter becoming urgent. I hope this is the right place for it... I have created a very...
3
by: Juhan | last post by:
Hi! I have a strange error in a console application that is hosted by IIS 5.0 and invokes a web service hosted on the same machine. A request form the web comes in and it is dispatched to a...
1
by: martin | last post by:
Hi, I'm having some problems with the System.Diagnostics.EventLog class in .NET 2.0 I need to recreate an event message source inside a new log but the messages keeps ending up in the old...
2
by: Paul Hatcher | last post by:
Has there been a change in behaviour of switches between 1.1 and 2.0. I have a web site that defines a switch and then an application that adds the same switch but with a different value. Under...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
0
by: =?Utf-8?B?QWxleA==?= | last post by:
Hi. Does anybody know if System.Diagnostics.TraceSource is supported under ASP.NET? I've used this class along with SourceSwitch and TextWriterTraceListener in Windows apps but this is the first...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.