The code appears unlikely to cause the problems you describe.
Without seeing the calling code, I can only guess. So here's my SWAG: you
mention what will happen if the config document cannot be read by the web
service due to permissions errors. I assume that this code is within a
try-catch somewhere. Is that try-catch at the event level, which makes it
look like the code is triggering another event?
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"jdm" <ja**********@pnl.gov> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Using the function below, I'm importing configuration parameters, from
an xml file, into a Windows service. This code works as expected in a
regular Windows application, but when used in a Windows service
(written in vb.net), it produces unintended side effects. The most
notable being multiple (and simultaneous) firings of timer events. Is
there a better way? Thank you.
Private Function MyNodeValue(ByVal strPath As String)
'This function reads a value from an XML file.
Dim xmlDoc As New System.Xml.XmlDocument
xmlDoc.Load(strPathToXMLfile)
Try
MyNodeValue = xmlDoc.SelectSingleNode(strPath &
"/text()").Value()
Catch
'Throw the error back to the calling routine.
Throw
End Try
End Function