all groups > dotnet distributed apps > november 2007 >
You're in the

dotnet distributed apps

group:

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


VB.net Windows Service - how to debug a live installation. SteveS
11/12/2007 5:12:00 PM
dotnet distributed apps: 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,
--
Re: VB.net Windows Service - how to debug a live installation. Bryan Phillips
11/17/2007 4:51:35 PM
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



[quoted text, click to view]
Re: VB.net Windows Service - how to debug a live installation. SteveS
11/20/2007 5:14:00 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


[quoted text, click to view]
Re: VB.net Windows Service - how to debug a live installation. SteveS
11/20/2007 11:49:01 AM
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


[quoted text, click to view]
Re: VB.net Windows Service - how to debug a live installation. Bryan Phillips
11/20/2007 6:54:00 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



[quoted text, click to view]
Re: VB.net Windows Service - how to debug a live installation. Bryan Phillips
11/22/2007 6:23:04 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



[quoted text, click to view]
Re: VB.net Windows Service - how to debug a live installation. SteveS
11/24/2007 2:39:00 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


[quoted text, click to view]
Re: VB.net Windows Service - how to debug a live installation. Bryan Phillips
11/25/2007 5:44:05 PM
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



[quoted text, click to view]
AddThis Social Bookmark Button