469,270 Members | 1,131 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Help With Windows Services

Hi All

I have a task that I'm thinking about attacking in two different ways
but don't know enough about Windows Services.

First:

We have a server application written in VB.net that acts as a
middleman between various Fortan DLL's (the calculation engines) and
various front end client applications (one in Java and two in
VB.net). The front ends check to see if the server application is
running when they need some calculations and if it's not running they
start it up. Simple enough and works great.

Well, now the powers that be have decided that the server application
should be a Windows Service (and always be running), rather than a
standalone executable.

I thought that I had correctly converted the project to a service. It
compiles and installs just fine. And it seems to run with no
problems. However, when I actually make a call to the service I keep
getting errors back (from Fortran) telling me that various
configuration files are missing (these are text files and binary files
containing engineering data needed by the Fortran code). They are in
the same location that they have always been (the same folder as the
windows service EXE), but for some reason now they can't be found,
where as before there was no issue. Having a difficult time
determining whether this is a Fortran or a VB.net problem, especially
since the debugging is trickier for Windows Services than just for
straight executables.

Is there a special location on the drive when all support files for
any Windows Service need to be located?

Second:

Another idea I had is rather than integrate all of the code from the
server application into a new Windows service, I'd possibly keep the
same executable and have the service just act as a wrapper, always
monitoring whether or not the server application executable is running
and restarting it whenever it stops (for whatever reason). This would
seem to be much simpler and would leave open the option of returning
to the old method should we decide that the windows service route
isn't for us (we all know that management tends to change their minds
often). I had originally pursued this path but was unsure how to do
this with only the service OnStart and OnStop methods available.

Thanks in advance for any assistance.

Nov 8 '07 #1
4 1187
On Nov 8, 7:26 am, ags5406 <my.spam.5...@gmail.comwrote:
Hi All

I have a task that I'm thinking about attacking in two different ways
but don't know enough about Windows Services.

First:

We have a server application written in VB.net that acts as a
middleman between various Fortan DLL's (the calculation engines) and
various front end client applications (one in Java and two in
VB.net). The front ends check to see if the server application is
running when they need some calculations and if it's not running they
start it up. Simple enough and works great.

Well, now the powers that be have decided that the server application
should be a Windows Service (and always be running), rather than a
standalone executable.

I thought that I had correctly converted the project to a service. It
compiles and installs just fine. And it seems to run with no
problems. However, when I actually make a call to the service I keep
getting errors back (from Fortran) telling me that various
configuration files are missing (these are text files and binary files
containing engineering data needed by the Fortran code). They are in
the same location that they have always been (the same folder as the
windows service EXE), but for some reason now they can't be found,
where as before there was no issue. Having a difficult time
determining whether this is a Fortran or a VB.net problem, especially
since the debugging is trickier for Windows Services than just for
straight executables.

Is there a special location on the drive when all support files for
any Windows Service need to be located?

Second:

Another idea I had is rather than integrate all of the code from the
server application into a new Windows service, I'd possibly keep the
same executable and have the service just act as a wrapper, always
monitoring whether or not the server application executable is running
and restarting it whenever it stops (for whatever reason). This would
seem to be much simpler and would leave open the option of returning
to the old method should we decide that the windows service route
isn't for us (we all know that management tends to change their minds
often). I had originally pursued this path but was unsure how to do
this with only the service OnStart and OnStop methods available.

Thanks in advance for any assistance.
Since all of your front end's are java and .net - have you considered
turning your server app into a web service?

--
Tom Shelton

Nov 8 '07 #2
On Nov 8, 9:02 am, Tom Shelton <tom_shel...@comcast.netwrote:
>
Since all of your front end's are java and .net - have you considered
turning your server app into a web service?

--
Tom Shelton
Have not. Know even less about web services (nothing actually). Does
that require a network connection?

Several of the clients are run on network computers. However, the
main (possibly most important) client runs on a laptop computer (or
other terminal) completely disconnected from any network in an
airborne vehicle. So the client, the server app, and the DLL's are
essentially in a vacuum on each machine.
Nov 8 '07 #3
On Nov 8, 8:42 am, ags5406 <my.spam.5...@gmail.comwrote:
On Nov 8, 9:02 am, Tom Shelton <tom_shel...@comcast.netwrote:
Since all of your front end's are java and .net - have you considered
turning your server app into a web service?
--
Tom Shelton

Have not. Know even less about web services (nothing actually). Does
that require a network connection?

Several of the clients are run on network computers. However, the
main (possibly most important) client runs on a laptop computer (or
other terminal) completely disconnected from any network in an
airborne vehicle. So the client, the server app, and the DLL's are
essentially in a vacuum on each machine.
The web service could still work... But you are probably better off
using a service. So the problem that your having with the service is
that it is not finding some of it's resources?

--
Tom Shelton

Nov 8 '07 #4
The web service could still work... But you are probably better off
using a service. So the problem that your having with the service is
that it is not finding some of it's resources?

--
Tom Shelton
Well oddly enough I've solved my problem. What seems to happen so
often is I struggle and struggle with a problem and then right after I
post here the answer dawns on me. It was actually pretty simple. I
went with method two as I described in my original message. It allows
me to preserve the original server application.
>From the OnStart method in the windows service I launched a separate
thread (so the OnStart method could actually complete its task). And
then within the thread I simply created an infinite loop to keep
checking the process list and to launch the server app if it is
missing from the process list.

Nov 8 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Craig Keightley | last post: by
9 posts views Thread by Popoxinhxan | last post: by
4 posts views Thread by Jm | last post: by
1 post views Thread by Microsoft News | last post: by
13 posts views Thread by Siegfried Heintze | last post: by
5 posts views Thread by dm3281 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.