473,756 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I attach an External Debug Window to My Running Executable?

Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for
a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the
problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to
receive trace information for display in a window, or is there a third-party
tool?

TIA

Charles
Nov 20 '05 #1
6 1903
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp

Ken
----------------------
"Charles Law" <bl***@nowhere. com> wrote in message
news:u5******** ******@TK2MSFTN GP10.phx.gbl...
Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for
a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the
problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to
receive trace information for display in a window, or is there a third-party
tool?

TIA

Charles

Nov 20 '05 #2
Hi Ken

Thanks for the link. I just came across this actually, but the downside is
that it would seem that I have to have the development environment installed
on the client machine. Is that correct?

I am really looking for something quite simple. If I have Trace statements
in my code then the output goes to the Output window in the VS debugger. I
would like to receive those messages in an external program - perhaps one
that I have to write. Do you know if it can be done?

Charles
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:uL******** ******@tk2msftn gp13.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp
Ken
----------------------
"Charles Law" <bl***@nowhere. com> wrote in message
news:u5******** ******@TK2MSFTN GP10.phx.gbl...
Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to receive trace information for display in a window, or is there a third-party tool?

TIA

Charles

Nov 20 '05 #3
Hi,

Maybe this will help.
http://www.codeguru.com/vb/gen/vb_sy...cle.php/c7525/

http://msdn.microsoft.com/msdnmag/is...g/default.aspx

Ken
-------------------
"Charles Law" <bl***@nowhere. com> wrote in message
news:Ol******** ******@TK2MSFTN GP09.phx.gbl...
Hi Ken

Thanks for the link. I just came across this actually, but the downside is
that it would seem that I have to have the development environment installed
on the client machine. Is that correct?

I am really looking for something quite simple. If I have Trace statements
in my code then the output goes to the Output window in the VS debugger. I
would like to receive those messages in an external program - perhaps one
that I have to write. Do you know if it can be done?

Charles
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:uL******** ******@tk2msftn gp13.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp
Ken
----------------------
"Charles Law" <bl***@nowhere. com> wrote in message
news:u5******** ******@TK2MSFTN GP10.phx.gbl...
Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to receive trace information for display in a window, or is there a third-party tool?

TIA

Charles


Nov 20 '05 #4
Hi Ken

The codeguru article looks like just the job. Thanks.

Charles
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:er******** ******@tk2msftn gp13.phx.gbl...
Hi,

Maybe this will help.
http://www.codeguru.com/vb/gen/vb_sy...cle.php/c7525/

http://msdn.microsoft.com/msdnmag/is...g/default.aspx

Ken
-------------------
"Charles Law" <bl***@nowhere. com> wrote in message
news:Ol******** ******@TK2MSFTN GP09.phx.gbl...
Hi Ken

Thanks for the link. I just came across this actually, but the downside is
that it would seem that I have to have the development environment installed on the client machine. Is that correct?

I am really looking for something quite simple. If I have Trace statements
in my code then the output goes to the Output window in the VS debugger. I
would like to receive those messages in an external program - perhaps one
that I have to write. Do you know if it can be done?

Charles
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:uL******** ******@tk2msftn gp13.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp

Ken
----------------------
"Charles Law" <bl***@nowhere. com> wrote in message
news:u5******** ******@TK2MSFTN GP10.phx.gbl...
Suppose my application is running on a client machine, and they report an intermittent problem. It only occurs after the program has been running

for
a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a third-party program), load it onto the client machine - without stopping

the
problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application

to
receive trace information for display in a window, or is there a

third-party
tool?

TIA

Charles


Nov 20 '05 #5

The following works with the standart output:

in your app.exe.config file add
<system.diagnos tics>
<switches>
<add name="myTraceFl ag1" value="0"/>
</switches>
</system.diagnost ics>

When the customer have a problem, tell him to change the value, e.g
<add name="myTraceFl ag" value="4"/>

value options:
0 none TraceSwitch is disabled.
1 TraceError: Only Errors.
2 TraceWarning: Errors and Warnings.
3 TraceInformatio n: Errors, Warnings, and Info.
4 TraceVerbose: All kinds of messages are traced.
No filter is applied.

' in your application add the following code:
Dim tl As New TextWriterTrace Listener(System .Console.Out)
Trace.Listeners .Add(tl)

' Use Trace.WriteLine If :
dim ts As New TraceSwitch("my TraceFlag1", "descriptio n")
Trace.WriteLine If(ts.TraceInfo , myStrStatus)
Trace.WriteLine If(ts.TraceWarn ing, myStrStatus)
Run your application using stdOutput:
myApp.exe > myWarnings.txt

and you will get your Trace lines in "myWarnings.txt " file

Atara



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #6
Thanks Atara. A neat solution.

Charles
"Atara" <At***@DD.com > wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..

The following works with the standart output:

in your app.exe.config file add
<system.diagnos tics>
<switches>
<add name="myTraceFl ag1" value="0"/>
</switches>
</system.diagnost ics>

When the customer have a problem, tell him to change the value, e.g
<add name="myTraceFl ag" value="4"/>

value options:
0 none TraceSwitch is disabled.
1 TraceError: Only Errors.
2 TraceWarning: Errors and Warnings.
3 TraceInformatio n: Errors, Warnings, and Info.
4 TraceVerbose: All kinds of messages are traced.
No filter is applied.

' in your application add the following code:
Dim tl As New TextWriterTrace Listener(System .Console.Out)
Trace.Listeners .Add(tl)

' Use Trace.WriteLine If :
dim ts As New TraceSwitch("my TraceFlag1", "descriptio n")
Trace.WriteLine If(ts.TraceInfo , myStrStatus)
Trace.WriteLine If(ts.TraceWarn ing, myStrStatus)
Run your application using stdOutput:
myApp.exe > myWarnings.txt

and you will get your Trace lines in "myWarnings.txt " file

Atara



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #7

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

Similar topics

3
1405
by: AKA COOPERMAN | last post by:
As C# express only creates RELEASE builds, how do I get my Debug.WriteLine statements to work ?
3
1490
by: Sebastien Tardif | last post by:
After I open a workspace I have access to all C++ files of the workspace. I can put breakpoints. Everything look great... So I go attach to my process and Visual C++ go close my workspace! I don't see the goal of closing the workspace... How can I fix this strange behavior/bug?
9
1915
by: Jon Davis | last post by:
I am working with an application that is compiled as a COM EXE (written in Delphi 7). I don't know if it's the nature of COM EXE or if it's implemented in the COM EXE, but when I create a new object based on the COM interface using C#, it references the first process/instance it finds of this interface. This is not ideal for me; I would like to create a modal dialog box that makes the user select which process to "attach" to. Getting a list...
1
2107
by: Martin Simard | last post by:
Hi all, In VS 2003, when I attach to a remote process for debugging, I can see the list of modules loaded by the process before attaching to it. This list is not there anymore in VS 2005. Instead, I just have a warning for security reasons and 2 buttons (Attach | Don't attach). Let me explain a bit... I have several web applications running on different servers. All servers are XP 2003 Servers with IIS 6. My applications runs in...
6
5968
by: Scubadude | last post by:
Hi, I'm new to perl and have run into some roadblocks while trying to run tutorials. I have installed Apache v2.2.3 I have installed ActivePerl v6.6.1.638 I have installed php v5.2.0 I am running Komodo professional, version 3.5.3
5
2256
by: Kees de Winter | last post by:
Is it possible to attach the VS2005 debugger to an already running, and published website? If I choose "Attach to process" from the menu and then select the right process, set breakpoints, run the code, nothing happens. Thanks for your help. -- Kees
7
15668
by: 2b|!2b==? | last post by:
I am attempting to manually load debug symbols for a module. I am doing it by carrying out the ff steps: i). Select the call stack window ii). right click and select 'Load Symbols' from displayed menu iii). The Find Symbols: MyModule.pdb dialog box is displayed However, when I navigate to and select the correct pdb file (myModule.pdb), an error message is displayed with the message:
4
3144
by: Brad Pears | last post by:
I have a vb.net 2005 project and have made a lot of modifications to it. The project runs fine in debug mode. Now I want to implement it and first I am running the executable on my machine to make sure it runs properly... However, when I run it locally as an executable, I get no end to run time errors - things like conversions from type string to integer etc...etc.... There's seems to be a billion problems all of a sudden. I have option...
6
3226
by: GaryDean | last post by:
I see some references on debugging by attaching to a process. There are MSDN articles that show how to attach to a process for debugging. However, I can find no info on how exactly to get the debugging to work. I have a wizard page in the anonymous section of my website. If I run it as the startup page in VS it runs fine. But if I link to it from an external link, it gets "object reference not set to an instance of an object" when I...
0
9456
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...
0
9275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10034
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9843
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
8713
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
7248
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
5142
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...
1
3805
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
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.