473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 13400
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
Nov 20 '05 #2
nobody wrote:
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


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\net\arubaservice\bin\arubaservice.exe '.
Affected parameters are:
assemblypath = c:\data\sid\net\arubaservice\bin\arubaservice.exe
logfile = c:\data\sid\net\arubaservice\bin\arubaservice.Inst allLog
No public installers with the RunInstallerAttribute.Yes attribute could
be found in the c:\data\sid\net\arubaservice\bin\arubaservice.exe assembly.
Committing assembly 'c:\data\sid\net\arubaservice\bin\arubaservice.exe '.
Affected parameters are:
assemblypath = c:\data\sid\net\arubaservice\bin\arubaservice.exe
logfile = c:\data\sid\net\arubaservice\bin\arubaservice.Inst allLog
No public installers with the RunInstallerAttribute.Yes attribute could
be found in the c:\data\sid\net\arubaservice\bin\arubaservice.exe assembly.
Remove InstallState file because there are no installers.
Nov 20 '05 #3
SiD` <mi****@ngi.it> wrote in message
<Lx**********************@news3.tin.it>...
nobody wrote:
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 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\net\arubaservice\bin\arubaservice.exe '.
Affected parameters are:
assemblypath = c:\data\sid\net\arubaservice\bin\arubaservice.exe
logfile = c:\data\sid\net\arubaservice\bin\arubaservice.Inst allLog
No public installers with the RunInstallerAttribute.Yes attribute could
be found in the c:\data\sid\net\arubaservice\bin\arubaservice.exe
assembly.
Committing assembly 'c:\data\sid\net\arubaservice\bin\arubaservice.exe '.
Affected parameters are:
assemblypath = c:\data\sid\net\arubaservice\bin\arubaservice.exe
logfile = c:\data\sid\net\arubaservice\bin\arubaservice.Inst allLog
No public installers with the RunInstallerAttribute.Yes attribute could
be found in the c:\data\sid\net\arubaservice\bin\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 (ProjectInstaller.vb), on the Design-view of
that page, there are two other controls (ServiceProcessInstaller1 and
ServiceInstaller).
- 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.it> wrote in message
<Lx**********************@news3.tin.it>...

nobody wrote:
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


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\net\arubaservice\bin\arubaservice.exe '.
Affected parameters are:
assemblypath = c:\data\sid\net\arubaservice\bin\arubaservice.exe
logfile = c:\data\sid\net\arubaservice\bin\arubaservice.Inst allLog
No public installers with the RunInstallerAttribute.Yes attribute could
be found in the c:\data\sid\net\arubaservice\bin\arubaservice.exe
assembly.
Committing assembly 'c:\data\sid\net\arubaservice\bin\arubaservice.exe '.
Affected parameters are:
assemblypath = c:\data\sid\net\arubaservice\bin\arubaservice.exe
logfile = c:\data\sid\net\arubaservice\bin\arubaservice.Inst allLog
No public installers with the RunInstallerAttribute.Yes attribute could
be found in the c:\data\sid\net\arubaservice\bin\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 (ProjectInstaller.vb), on the Design-view of
that page, there are two other controls (ServiceProcessInstaller1 and
ServiceInstaller).
- 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.it> wrote in message
news:4_**********************@news3.tin.it...
nobody wrote:
SiD` <mi****@ngi.it> wrote in message
<Lx**********************@news3.tin.it>...

nobody wrote:

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

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\net\arubaservice\bin\arubaservice.exe '.
Affected parameters are:
assemblypath = c:\data\sid\net\arubaservice\bin\arubaservice.exe
logfile = c:\data\sid\net\arubaservice\bin\arubaservice.Inst allLog
No public installers with the RunInstallerAttribute.Yes attribute could
be found in the c:\data\sid\net\arubaservice\bin\arubaservice.exe
assembly.
Committing assembly 'c:\data\sid\net\arubaservice\bin\arubaservice.exe '.
Affected parameters are:
assemblypath = c:\data\sid\net\arubaservice\bin\arubaservice.exe
logfile = c:\data\sid\net\arubaservice\bin\arubaservice.Inst allLog
No public installers with the RunInstallerAttribute.Yes attribute could
be found in the c:\data\sid\net\arubaservice\bin\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 (ProjectInstaller.vb), on the Design-view of
that page, there are two other controls (ServiceProcessInstaller1 and
ServiceInstaller).
- 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
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...
9
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...
7
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...
6
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...
2
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...
4
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...
7
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...
2
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.