System.Diagnostics.Switch problems

  • Thread starter Thread starter Michael Riggio
  • Start date Start date
M

Michael Riggio

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
 
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?
 
Here's the link:
http://msdn.microsoft.com/library/e...iagnosticsswitchclassctortopic.asp?frame=true

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

Thanks,
-Mike

Dmitriy Lapshin said:
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

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
 
Back
Top