473,772 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb.net service debug start error

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
Nov 20 '05 #1
5 13418
SiD` <mi****@ngi.i t> wrote in message
<2%************ **********@news 3.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\Micr osoft.NET\Frame work\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\Exe cutableName.exe "
* FolderName is the folder that contains your executable, for instance
C:\Documents and Settings\Admini strator\Visual Studio Projects\Soluti on1\bin
* ExecutableName is the name of the executable, for instance MyService

So your full command should be something like this:
C:
cd \
cd Windows\Microso ft.NET\Framewor k\v1.1.4322
installutil "C:\Documen ts and Settings\Admini strator\Visual Studio
Projects\Soluti on1\bin\MyServi ce.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
Nov 20 '05 #2
nobody wrote:
SiD` <mi****@ngi.i t> wrote in message
<2%************ **********@news 3.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


well, as I said, install fails because there is no install package.
but the main problem is that I want to run the program in debug mode.

installog:
Installing assembly 'c:\data\sid\ne t\arubaservice\ bin\arubaservic e.exe'.
Affected parameters are:
assemblypath = c:\data\sid\net \arubaservice\b in\arubaservice .exe
logfile = c:\data\sid\net \arubaservice\b in\arubaservice .InstallLog
No public installers with the RunInstallerAtt ribute.Yes attribute could
be found in the c:\data\sid\net \arubaservice\b in\arubaservice .exe assembly.
Committing assembly 'c:\data\sid\ne t\arubaservice\ bin\arubaservic e.exe'.
Affected parameters are:
assemblypath = c:\data\sid\net \arubaservice\b in\arubaservice .exe
logfile = c:\data\sid\net \arubaservice\b in\arubaservice .InstallLog
No public installers with the RunInstallerAtt ribute.Yes attribute could
be found in the c:\data\sid\net \arubaservice\b in\arubaservice .exe assembly.
Remove InstallState file because there are no installers.
Nov 20 '05 #3
SiD` <mi****@ngi.i t> wrote in message
<Lx************ **********@news 3.tin.it>...
nobody wrote:
SiD` <mi****@ngi.i t> wrote in message
<2%************ **********@news 3.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 startedewith 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


well, as I said, install fails because there is no install package.
but the main problem is that I want to run the program in debug mode.

installog:
Installing assembly 'c:\data\sid\ne t\arubaservice\ bin\arubaservic e.exe'.
Affected parameters are:
assemblypath = c:\data\sid\net \arubaservice\b in\arubaservice .exe
logfile = c:\data\sid\net \arubaservice\b in\arubaservice .InstallLog
No public installers with the RunInstallerAtt ribute.Yes attribute could
be found in the c:\data\sid\net \arubaservice\b in\arubaservice .exe
assembly.
Committing assembly 'c:\data\sid\ne t\arubaservice\ bin\arubaservic e.exe'.
Affected parameters are:
assemblypath = c:\data\sid\net \arubaservice\b in\arubaservice .exe
logfile = c:\data\sid\net \arubaservice\b in\arubaservice .InstallLog
No public installers with the RunInstallerAtt ribute.Yes attribute could
be found in the c:\data\sid\net \arubaservice\b in\arubaservice .exe
assembly.
Remove InstallState file because there are no installers.


Well, then your Service isn't finished. You have to add an Installer to
your service.

Do it like this:
- Go to the Design-view of your service and right-click your mouse. Choose
the option 'Add installer'.
- A new component shows up (ProjectInstall er.vb), on the Design-view of
that page, there are two other controls (ServiceProcess Installer1 and
ServiceInstalle r).
- Adjust these two components with your data
- Build your Service (Ctrl + Shift + B)
- Install it
- Run it!
- If you still receive errors after successfull installation, put an extra
line in your On_start event. Put this at the begin, then every time you
start the service it will ask you to select a debugger. This way you can
detect and solve the errors!
This is the line:
Debugger.Launch ()
Greetings
Nov 20 '05 #4
nobody wrote:
SiD` <mi****@ngi.i t> wrote in message
<Lx************ **********@news 3.tin.it>...

nobody wrote:
SiD` <mi****@ngi.i t> wrote in message
<2%********* *************@n ews3.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


well, as I said, install fails because there is no install package.
but the main problem is that I want to run the program in debug mode.

installog:
Installing assembly 'c:\data\sid\ne t\arubaservice\ bin\arubaservic e.exe'.
Affected parameters are:
assemblypath = c:\data\sid\net \arubaservice\b in\arubaservice .exe
logfile = c:\data\sid\net \arubaservice\b in\arubaservice .InstallLog
No public installers with the RunInstallerAtt ribute.Yes attribute could
be found in the c:\data\sid\net \arubaservice\b in\arubaservice .exe
assembly.
Committing assembly 'c:\data\sid\ne t\arubaservice\ bin\arubaservic e.exe'.
Affected parameters are:
assemblypath = c:\data\sid\net \arubaservice\b in\arubaservice .exe
logfile = c:\data\sid\net \arubaservice\b in\arubaservice .InstallLog
No public installers with the RunInstallerAtt ribute.Yes attribute could
be found in the c:\data\sid\net \arubaservice\b in\arubaservice .exe
assembly.
Remove InstallState file because there are no installers.

Well, then your Service isn't finished. You have to add an Installer to
your service.

Do it like this:
- Go to the Design-view of your service and right-click your mouse. Choose
the option 'Add installer'.
- A new component shows up (ProjectInstall er.vb), on the Design-view of
that page, there are two other controls (ServiceProcess Installer1 and
ServiceInstalle r).
- Adjust these two components with your data
- Build your Service (Ctrl + Shift + B)
- Install it
- Run it!
- If you still receive errors after successfull installation, put an extra
line in your On_start event. Put this at the begin, then every time you
start the service it will ask you to select a debugger. This way you can
detect and solve the errors!
This is the line:
Debugger.Launch ()
Greetings


ok, thanks, it works this way.
But if I start the program with "services", it does not show me
anything, and the program probably shows messageboxes to nowhere, and
the prgz remains locked waiting for user action. Is there any way to
make the prgz debuggable by vs?
Nov 20 '05 #5

"SiD`" <mi****@ngi.i t> wrote in message
news:4_******** **************@ news3.tin.it...
nobody wrote:
SiD` <mi****@ngi.i t> wrote in message
<Lx************ **********@news 3.tin.it>...

nobody wrote:

SiD` <mi****@ngi.i t> wrote in message
<2%********* *************@n ews3.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

well, as I said, install fails because there is no install package.
but the main problem is that I want to run the program in debug mode.

installog:
Installing assembly 'c:\data\sid\ne t\arubaservice\ bin\arubaservic e.exe'.
Affected parameters are:
assemblypath = c:\data\sid\net \arubaservice\b in\arubaservice .exe
logfile = c:\data\sid\net \arubaservice\b in\arubaservice .InstallLog
No public installers with the RunInstallerAtt ribute.Yes attribute could
be found in the c:\data\sid\net \arubaservice\b in\arubaservice .exe
assembly.
Committing assembly 'c:\data\sid\ne t\arubaservice\ bin\arubaservic e.exe'.
Affected parameters are:
assemblypath = c:\data\sid\net \arubaservice\b in\arubaservice .exe
logfile = c:\data\sid\net \arubaservice\b in\arubaservice .InstallLog
No public installers with the RunInstallerAtt ribute.Yes attribute could
be found in the c:\data\sid\net \arubaservice\b in\arubaservice .exe
assembly.
Remove InstallState file because there are no installers.

Well, then your Service isn't finished. You have to add an Installer to
your service.

Do it like this:
- Go to the Design-view of your service and right-click your mouse. Choose the option 'Add installer'.
- A new component shows up (ProjectInstall er.vb), on the Design-view of
that page, there are two other controls (ServiceProcess Installer1 and
ServiceInstalle r).
- Adjust these two components with your data
- Build your Service (Ctrl + Shift + B)
- Install it
- Run it!
- If you still receive errors after successfull installation, put an extra line in your On_start event. Put this at the begin, then every time you
start the service it will ask you to select a debugger. This way you can
detect and solve the errors!
This is the line:
Debugger.Launch ()
Greetings


ok, thanks, it works this way.
But if I start the program with "services", it does not show me
anything, and the program probably shows messageboxes to nowhere, and
the prgz remains locked waiting for user action. Is there any way to
make the prgz debuggable by vs?


MsgBoxes do NOT belong in Windows Services, not even if you're
debugging them!!!

Rebuild your service in Debug Mode.
Reinstall it.
Put breakpoints into your code.
Start the Service, using Control Panel, let it get itself up and running,
then go back into the .Net IDE and Attach to the running process:

Menu: Debug > Processes
(find your process)
Click Attach

Your code /should/ now stop at the breakpoints you've defined.

HTH,
Phill W.
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5221
by: David Fraser | last post by:
Hi We are trying to debug a problem with services created using py2exe. It seems that these problems have arisen after services were installed and removed a few times. OK, first the actual problem we're seeing. After compiling a service with py2exe, running "service -install" and attempting to start it from the Services dialog, it pops up the message "Windows could not start the Service on Local Computer. For more information,...
9
7028
by: Hardy Wang | last post by:
Hi all: I read an article from http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp about how to install a windows service programmatically. Based ont the code sample, it provides the feature to install service under LocalSystem account. What I need is to install service under some other certian account. By further studying the code, and MSDN...
7
7282
by: BW | last post by:
Hi all! I'm not sure where to post this so I'm giving these a try. If there is a better (more appropriate) place to post please let me know. I want to create a service (in C#). The service's purpose is to monitor a given service, and when the service becomes disabled and/or stopped I want to restart the service. I have figured out how to restart a stopped service by using the ServiceController.Start() method.
6
3460
by: acool | last post by:
I managed to get my VB.NET service installed. Now I can't get it to do anything. Tell me how do you debug smething like this if you have to manually install the assembly to run it? the same code works just fine in a VB form but when I initiallize with the WS OnStart event I get nothing. Any help is greatly appreciated. TB
2
2460
by: Trevor | last post by:
Argh! This problem is driving me nuts! Can you help? In November of 2003, I installed a web service on Windows Server 2003 built in VB.NET for v1.1.4322 of the framework. It contains a timer (System.Timers.Timer) which has an interval of 24 hours. Actually, it reads a time like 2AM out of the config file, and calculates the time between the start of the service to 2AM, and sets the timer. When the timer expires, it re-reads the...
4
6453
by: cmgarcia17 | last post by:
I have two windows services that I've written: the first is a "Listener Service" that listens for MSMQ Message delivery. The second is a "Watcher Service" that monitors the state of the first. If the "Listener Service" goes down I want the "Watcher Service" to receive a notification and perform a set action. To enable this communication I've written a separate assembly (that both services reference) that exposes two interfaces :...
7
13399
by: =?Utf-8?B?Sm9obi5ORVQ=?= | last post by:
Hi I have written a windows service in C# / .NET I have installed it and it's working fine on a couple boxes but on my XP box I get this error when I try to start it: Error 1053: The service did not respond to the start or control request in a timely fashion. I understand that the scm issue the start and is supposed to put up this error after some timeout period but it's coming up after only about half a second and it doesnt even...
2
1569
by: TonyJ | last post by:
Hello! Below I have the two methods OnStart and Start that are relevant to my question. If I do net start TimeServerService I will see something like Service TimeServerService starting ......... It wasn't possible to start the service TimeServerService The reason for this it that OnStart doesn't return becuse it will stuck in a loop in the Start metod.
5
5588
by: Oriane | last post by:
Hi, I have a .Net Visual Studio solution with one asp.net Web application, which uses a Asp.Net Web service. Both are compiled in debug mode, and both are using the Studio development web server for debugging. I have also add the Web reference to the web service with the "Add Web service in the solution" choice, that is the Web app starts the Web service with the Studio development web server. So I thought I could set breakpoints on...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4009
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2851
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.