HighTechTalks DotNet Forums  

VB.net Windows Service - how to debug a live installation.

Dotnet Distributed Applications microsoft.public.dotnet.distributed_apps


Discuss VB.net Windows Service - how to debug a live installation. in the Dotnet Distributed Applications forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
SteveS
 
Posts: n/a

Default VB.net Windows Service - how to debug a live installation. - 11-12-2007 , 07:12 PM






I have a service running fairly well but it still has some bugs in it that I
can not reproduce in my test environment. It is a multi-threaded application!

My question: is there a way to connect Visual Studio 2005 (sp1) to the
program to debug the code while it is still running at a remote site? If I
could just single step the program while it is failing, I am sure I would get
the answer very quickly.

Thanks,
--
SteveS

Reply With Quote
  #2  
Old   
Bryan Phillips
 
Posts: n/a

Default Re: VB.net Windows Service - how to debug a live installation. - 11-17-2007 , 10:51 AM






Yes, you can debug it remotely. Recompile the windows service in debug
mode, install it, run the remote debugging monitor on the remote server
(http://msdn2.microsoft.com/en-us/library/xf8k2h6a.aspx), start the
service, and use visual studio to connect to the remote process.

Be aware that it will be difficult at best to debug any code in the
OnStart method based on how fast you can click to attach to the service
after you start it so it best that you move any code out of that method.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote


Quote:
I have a service running fairly well but it still has some bugs in it that I
can not reproduce in my test environment. It is a multi-threaded application!

My question: is there a way to connect Visual Studio 2005 (sp1) to the
program to debug the code while it is still running at a remote site? If I
could just single step the program while it is failing, I am sure I would get
the answer very quickly.

Thanks,
--
SteveS


Reply With Quote
  #3  
Old   
SteveS
 
Posts: n/a

Default Re: VB.net Windows Service - how to debug a live installation. - 11-20-2007 , 07:14 AM



I have successfully attached to the process but there is no code to look at?
How do I single step if there is no code? How do I load the source code up?

--
SteveS


"Bryan Phillips" wrote:

Quote:
Yes, you can debug it remotely. Recompile the windows service in debug
mode, install it, run the remote debugging monitor on the remote server
(http://msdn2.microsoft.com/en-us/library/xf8k2h6a.aspx), start the
service, and use visual studio to connect to the remote process.

Be aware that it will be difficult at best to debug any code in the
OnStart method based on how fast you can click to attach to the service
after you start it so it best that you move any code out of that method.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
news0E8EB2C-6990-4FC5-BF9A-0C26C9EE98BC (AT) microsoft (DOT) com:

I have a service running fairly well but it still has some bugs in it that I
can not reproduce in my test environment. It is a multi-threaded application!

My question: is there a way to connect Visual Studio 2005 (sp1) to the
program to debug the code while it is still running at a remote site? If I
could just single step the program while it is failing, I am sure I would get
the answer very quickly.

Thanks,
--
SteveS



Reply With Quote
  #4  
Old   
Bryan Phillips
 
Posts: n/a

Default Re: VB.net Windows Service - how to debug a live installation. - 11-20-2007 , 12:54 PM



Did you compile in Debug mode? If so, try stepping a few times to see
if the debugger stopped just before your code.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote


Quote:
I have successfully attached to the process but there is no code to look at?
How do I single step if there is no code? How do I load the source code up?

--
SteveS


"Bryan Phillips" wrote:

Yes, you can debug it remotely. Recompile the windows service in debug
mode, install it, run the remote debugging monitor on the remote server
(http://msdn2.microsoft.com/en-us/library/xf8k2h6a.aspx), start the
service, and use visual studio to connect to the remote process.

Be aware that it will be difficult at best to debug any code in the
OnStart method based on how fast you can click to attach to the service
after you start it so it best that you move any code out of that method.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
news0E8EB2C-6990-4FC5-BF9A-0C26C9EE98BC (AT) microsoft (DOT) com:

I have a service running fairly well but it still has some bugs in it that I
can not reproduce in my test environment. It is a multi-threaded application!

My question: is there a way to connect Visual Studio 2005 (sp1) to the
program to debug the code while it is still running at a remote site? If I
could just single step the program while it is failing, I am sure I would get
the answer very quickly.

Thanks,
--
SteveS




Reply With Quote
  #5  
Old   
SteveS
 
Posts: n/a

Default Re: VB.net Windows Service - how to debug a live installation. - 11-20-2007 , 01:49 PM



I compiled in Debug mode (I think) and now I am getting the following message
after I hit Break All:

No symbols are loaded for any call stack frame. The source code cannot be
displayed.

OK or Show Disassembly


--
SteveS


"Bryan Phillips" wrote:

Quote:
Did you compile in Debug mode? If so, try stepping a few times to see
if the debugger stopped just before your code.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
newsCF5D753-1EB1-4830-B16B-A91976FDF00F (AT) microsoft (DOT) com:

I have successfully attached to the process but there is no code to look at?
How do I single step if there is no code? How do I load the source code up?

--
SteveS


"Bryan Phillips" wrote:

Yes, you can debug it remotely. Recompile the windows service in debug
mode, install it, run the remote debugging monitor on the remote server
(http://msdn2.microsoft.com/en-us/library/xf8k2h6a.aspx), start the
service, and use visual studio to connect to the remote process.

Be aware that it will be difficult at best to debug any code in the
OnStart method based on how fast you can click to attach to the service
after you start it so it best that you move any code out of that method.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
news0E8EB2C-6990-4FC5-BF9A-0C26C9EE98BC (AT) microsoft (DOT) com:

I have a service running fairly well but it still has some bugs in it that I
can not reproduce in my test environment. It is a multi-threaded application!

My question: is there a way to connect Visual Studio 2005 (sp1) to the
program to debug the code while it is still running at a remote site? If I
could just single step the program while it is failing, I am sure I would get
the answer very quickly.

Thanks,
--
SteveS





Reply With Quote
  #6  
Old   
Bryan Phillips
 
Posts: n/a

Default Re: VB.net Windows Service - how to debug a live installation. - 11-22-2007 , 12:23 AM



For some reason, it can't find your debug symbols. Open the modules
window, right-click your exe, and select load symbols. It should prompt
you for the location of the symbols.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote


Quote:
I compiled in Debug mode (I think) and now I am getting the following message
after I hit Break All:

No symbols are loaded for any call stack frame. The source code cannot be
displayed.

OK or Show Disassembly


--
SteveS


"Bryan Phillips" wrote:

Did you compile in Debug mode? If so, try stepping a few times to see
if the debugger stopped just before your code.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
newsCF5D753-1EB1-4830-B16B-A91976FDF00F (AT) microsoft (DOT) com:

I have successfully attached to the process but there is no code to look at?
How do I single step if there is no code? How do I load the source code up?

--
SteveS


"Bryan Phillips" wrote:

Yes, you can debug it remotely. Recompile the windows service in debug
mode, install it, run the remote debugging monitor on the remote server
(http://msdn2.microsoft.com/en-us/library/xf8k2h6a.aspx), start the
service, and use visual studio to connect to the remote process.

Be aware that it will be difficult at best to debug any code in the
OnStart method based on how fast you can click to attach to the service
after you start it so it best that you move any code out of that method.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
news0E8EB2C-6990-4FC5-BF9A-0C26C9EE98BC (AT) microsoft (DOT) com:

I have a service running fairly well but it still has some bugs in it that I
can not reproduce in my test environment. It is a multi-threaded application!

My question: is there a way to connect Visual Studio 2005 (sp1) to the
program to debug the code while it is still running at a remote site? If I
could just single step the program while it is failing, I am sure I would get
the answer very quickly.

Thanks,
--
SteveS






Reply With Quote
  #7  
Old   
SteveS
 
Posts: n/a

Default Re: VB.net Windows Service - how to debug a live installation. - 11-24-2007 , 04:39 PM



In the Modules windows the path show the local installation of the executable
even though I "Attached to Process" on the remote machine?? So I uninstalled
the local install in "Add/Remove programs" and it still points to the local
path (c:\program files...)?

I then did as you suggested and I navigated over the network to the proper
folder and found the .pdb file, then when I click it says "The symbol file
PerfWS.pdb does not match the module"?

Why is this so difficult? What should I do?
--
SteveS


"Bryan Phillips" wrote:

Quote:
For some reason, it can't find your debug symbols. Open the modules
window, right-click your exe, and select load symbols. It should prompt
you for the location of the symbols.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
news:F24A72CD-34A9-4A5B-869A-4DD2AC203AF1 (AT) microsoft (DOT) com:

I compiled in Debug mode (I think) and now I am getting the following message
after I hit Break All:

No symbols are loaded for any call stack frame. The source code cannot be
displayed.

OK or Show Disassembly


--
SteveS


"Bryan Phillips" wrote:

Did you compile in Debug mode? If so, try stepping a few times to see
if the debugger stopped just before your code.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
newsCF5D753-1EB1-4830-B16B-A91976FDF00F (AT) microsoft (DOT) com:

I have successfully attached to the process but there is no code to look at?
How do I single step if there is no code? How do I load the source code up?

--
SteveS


"Bryan Phillips" wrote:

Yes, you can debug it remotely. Recompile the windows service in debug
mode, install it, run the remote debugging monitor on the remote server
(http://msdn2.microsoft.com/en-us/library/xf8k2h6a.aspx), start the
service, and use visual studio to connect to the remote process.

Be aware that it will be difficult at best to debug any code in the
OnStart method based on how fast you can click to attach to the service
after you start it so it best that you move any code out of that method.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
news0E8EB2C-6990-4FC5-BF9A-0C26C9EE98BC (AT) microsoft (DOT) com:

I have a service running fairly well but it still has some bugs in it that I
can not reproduce in my test environment. It is a multi-threaded application!

My question: is there a way to connect Visual Studio 2005 (sp1) to the
program to debug the code while it is still running at a remote site? If I
could just single step the program while it is failing, I am sure I would get
the answer very quickly.

Thanks,
--
SteveS







Reply With Quote
  #8  
Old   
Bryan Phillips
 
Posts: n/a

Default Re: VB.net Windows Service - how to debug a live installation. - 11-25-2007 , 11:44 AM



Delete the bin and obj folders from your project directory and
recompile. Then, try again.

Do you have more than one project in your solution? Is it possible that
you have excluded one of your projects from the build configuration?

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote


Quote:
In the Modules windows the path show the local installation of the executable
even though I "Attached to Process" on the remote machine?? So I uninstalled
the local install in "Add/Remove programs" and it still points to the local
path (c:\program files...)?

I then did as you suggested and I navigated over the network to the proper
folder and found the .pdb file, then when I click it says "The symbol file
PerfWS.pdb does not match the module"?

Why is this so difficult? What should I do?
--
SteveS


"Bryan Phillips" wrote:

For some reason, it can't find your debug symbols. Open the modules
window, right-click your exe, and select load symbols. It should prompt
you for the location of the symbols.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
news:F24A72CD-34A9-4A5B-869A-4DD2AC203AF1 (AT) microsoft (DOT) com:

I compiled in Debug mode (I think) and now I am getting the following message
after I hit Break All:

No symbols are loaded for any call stack frame. The source code cannot be
displayed.

OK or Show Disassembly


--
SteveS


"Bryan Phillips" wrote:

Did you compile in Debug mode? If so, try stepping a few times to see
if the debugger stopped just before your code.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
newsCF5D753-1EB1-4830-B16B-A91976FDF00F (AT) microsoft (DOT) com:

I have successfully attached to the process but there is no code to look at?
How do I single step if there is no code? How do I load the source code up?

--
SteveS


"Bryan Phillips" wrote:

Yes, you can debug it remotely. Recompile the windows service in debug
mode, install it, run the remote debugging monitor on the remote server
(http://msdn2.microsoft.com/en-us/library/xf8k2h6a.aspx), start the
service, and use visual studio to connect to the remote process.

Be aware that it will be difficult at best to debug any code in the
OnStart method based on how fast you can click to attach to the service
after you start it so it best that you move any code out of that method.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"SteveS" <srs (AT) perfectionsremovenospamsoftware (DOT) com> wrote in message
news0E8EB2C-6990-4FC5-BF9A-0C26C9EE98BC (AT) microsoft (DOT) com:

I have a service running fairly well but it still has some bugs in it that I
can not reproduce in my test environment. It is a multi-threaded application!

My question: is there a way to connect Visual Studio 2005 (sp1) to the
program to debug the code while it is still running at a remote site? If I
could just single step the program while it is failing, I am sure I would get
the answer very quickly.

Thanks,
--
SteveS








Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.