File I.O in a windows service

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

I am writing a windows service in VB.net that i would like to push out an xml file at a scheduled time. I have done this before in windows/console applications successfully. I have ran into a problem when i declare a new IO.Filestream variable in the windows service. It seems like my service quits. I have the application coded to write to the event log before and after my IO.FileStream declaration and it has never gotten past it. I have copied the exact code into a windows application and everything works perfectly. Does anyone have any idea why this is behaving this way? Any suggestions would be a big help. Here is a sample of my declaration.

Dim strmXMLfile As New IO.FileStream(Export_Path & Xml_File_Name, IO.FileMode.Create

Thanks
BA
 
worked fine for me. try debugging it. or post more details

i attached to the process and stepped through the code below and it worked

Dim sfile As New FileStream("c:\test\process.txt", FileMode.Create
Debug.WriteLine(sfile.Name

it created a process.txt file.
 
Back
Top