Service and Application

G

Guest

Situation
Languages: Vb NET
One Windows Service Project
One Windows Application Project
One InstallShield Setup Project

Windows Service must to launch Windows Applcation like...
Protected Overrides Sub OnStart(ByVal args() As String)
Try
With prcApplication
.StartInfo.FileName = Environment.CurrentDirectory &
"\Application.exe"
.Start()
End With
Catch excMain As Exception
End Try
End Sub

In the eventviewer receive this error message...
"System.ComponentModel.Win32Exc­eption: The system cannot find the file
specified at
System.Diagnostics.Process.Sta­rtWithShellExecuteEx(ProcessSt­artInfo
startInfo) at System.Diagnostics.Process.Sta­rt()...."

Con you help me????
 
C

Chris Dunaway

Have you inspected the value of Environment.CurrentDirectory? Is it
what you expect it to be? Is Application.exe located in that
directory? Are all the files that application.exe depends on in that
folder? Does the Service have the necessary permissions to execute
that application?

Just a few items to check, good luck.
 
G

Guest

Thanks Chris...

I've resolved

"Environment.CurrentDirectory" don't work I've replaced the string with

"System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location)"

Thanks for your interest...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top