Hi,
I'm not really sure where I should be posting this one, it's in the area of Word Interop, Windows Services and Asynchronous programming...
I have a Class Library DLL, which contains a function that processes a Word document (opens Word, does some stuff, quits Word). The class library contains another function that basically just wraps this to allow it to be called asynchronously.
When I include the DLL in a Windows Forms project I have and run it - it works fine, but when I include the DLL in the Windows Service project, it fails to process the Word Document, and also leaves Word open - even though the code goes into the catch section of the Try catch block which contains a Word.Quit.
SokakPosted Apr 4, 2007, 2:24 AM
Typically anything that falls into "Works as an application, fails or behaves unexpectedly as a service" boils down to security permissions. After you set up the service, try configuring it to run using your own login credentials (as a test) and see what it does. Essentially that should make your service behave the same as an Exe. The other key difference is the executing path, as a service it doesn't execute from the location you install the assemblies, if memory serves me it runs in Windows/System32. (XP) I believe it finds .config files ok, but if you use GetExecutingAssembly or relative paths you may be hitting snags.