-
October 11th, 2003, 02:36 PM
#1
TypeInitializationException and Windows Service
Hi, I'm writing a Windows Service that launches a Windows App on startup. So, what I did was, in OnStart( ):
System.Diagnostics.Process process = System.Diagnostics.Process.Start("C:\\Program Files\\Testing\\ThisWinApp.exe");
I successfully installed the service using InstallUtil.exe. When I "start" the service, I keep getting "TypeInitializationException". Account used in ServiceProcessInstaller is "LocalSystem" - does it has permission to run executable and run exe in "Program Files" folder? I can't configure these rights on my XP machine.
Reference: http://www.dotnet247.com/247referenc...30/150246.aspx
Anyway, I used caspol.exe to check permission on the assembly. Intersecting permission from across "level", the assembly (the Windows Service) got "Fulltrust". So, if it's got to do with security, it must be user role launching/starting the service.
Now, if it's not security, perhaps it's got to do with the fact that any class derived from ServicedBase can't launch anything that has a GUI?
Thanks in advance.
heHAA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|