Finally! My latest C# project is complete - a few days late, mostly because of the Strategic Architect Forum, but also because I ran into a couple of
"minor issues".
This was my first production code remoting app, it was also my first windows service - coming from a VB6 background, I have never had the luxury of using either of these options before.
So what did I learn?...Apart from the technologies themselves, which I have already studied last year, I learnt the following:
1) When you run your application as a windows service,
System.IO.Directory.GetCurrentDirectory() returns the windows\system32 folder, not the path you actual .exe resides in. Knowing this could have saved me a good few hours trying to figure out why my (*$$($**@(*ing tracing to text file no longer worked when I ran my project as a service...
2) Rather than creating your application as a console app and then trying to retro-fit it into a windows service, rather start from the template windows service that is provided (assuming you are using VS2003) and then use a test strap console application that references your service in order to test. You will also need to add a reference to
System.ServiceProcess in the console application in order to make this work.
Hope this helps someone save the hours I lost had I known the above before I started!