SiD` <mi****@ngi.it> wrote in message
<2%**********************@news3.tin.it>...
when starting a windows service writte in vb.net, a messagebox appears:
cannot start service from the command line or a debugger. A windows
service must first be installed using installutil.exe and then startede
with the serverexpl, windows services or the NET START command.
tryed also installing with installutil: it says there is no install packs.
how can I make my service work in design mode and in normal runtime mode?
thanks
My answer consists in 2 parts:
- first part: install your service
- second part: start your service
You should install your Windows service with installutil like this:
- Open a Command Prompt window
- Go to the following directory:
C:\Windows\Microsoft.NET\Framework\v1.1.4322
- last folder can also be v1.0.3705 depending on your version of .NET
Framework (v1.1 or v1.0)
- Then type this (it is important to include the quotes " if the path
contains spaces!):
installutil "FolderName\ExecutableName.exe"
* FolderName is the folder that contains your executable, for instance
C:\Documents and Settings\Administrator\Visual Studio Projects\Solution1\bin
* ExecutableName is the name of the executable, for instance MyService
So your full command should be something like this:
C:
cd \
cd Windows\Microsoft.NET\Framework\v1.1.4322
installutil "C:\Documents and Settings\Administrator\Visual Studio
Projects\Solution1\bin\MyService.exe"
- Now your Windows service is installed.
You can start your service in several ways:
- Open a Command Prompt window and type:
net start MyService
Greetings