Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1371
  • Last Modified:

Issues with visual studio's attach to process feature

Can somebody please guide me as how do i use Visual studio's "attach to process" feature EFFECTIVELY. I already went through couple of links  but could find none for my specific case.

There is one application i am working on assume A, which doesn't have its GUI. The GUI is located on a totally different web app, assume B. Application A generates a new dll everytime i hit debug or start without debug. Now I use that dll on external assembly of Application B to make sure everything works fine using my GUI. But to debug it i need to use the funtionality of attach to process and i am stuggling on that.

My question is how do i attach to process of a different web app. Right now what i do is:

On App B>Start Debugging>takes me to a abc.aspx>then i go to Debug>attach to process>select application B.exe on the list>attach (I believe i have attached the process of application A to B ----HOLD ON THIS IS NOT HAPPENING :(

Now i go to application A>put a breakpoint. then go back to abc.aspx>select the criteria which would take me to the break point ...but this doesn't happen, instead it yeilds out the result. which i don't want. I want this to stop on my breakpoint. Please sugest as what am i doing wrong.
0
Kerau
Asked:
Kerau
  • 3
  • 2
2 Solutions
 
GiftsonDJohnCommented:
Hi,

If the code is on your local machine then what you have to do is

1. Debug menu ==> Attach to process.
2. A dialog appears. If you are using IIS 5 then the worker processer would be aspnet_wp.exe. If it is IIS 6 then the worker processor is w3wp.exe.
3. Choose the worker processor and click on Attach. The debugger will start.

The main condition is the code should be identical on both the ends.

If your code is in the remote server, then you have to install remote debugger packed with your visual studio installation source. Start the remote debugger session on the remote machine. Set the proper credentials for you to connect and debug remotely.

1. Debug menu ==> Attach to Process
2. Under Qualifer Textbox give the name of the session. The session name can be obtained from the remote system where you start the remote debugger, it will say "4/22/2009 12:36:15 AM      Msvsmon started a new server named 'name@system'. Waiting for new connections.". You have to enter the value name@system in the Qualifier text box.
3. Look for the worker process.
4. Click on attach to start debugging.

0
 
abelCommented:
(Just some thoughts to consider, because I'm not sure if I follow your A->b->abc->A completely. On a follow up, can you use your real names or similar, to make it easier to understand the process and not getting mixed up?)

Your breakpoint will only be hit if your A.exe is build with debugging enabled.

Attach to process does not mean that you attach appl A to appl B. It means that the executable that you pointed to (B.exe) is attached to the debugger. If there are debugging symbols and/or information, the debugger can use that to locate the points in the code, or hit a breakpoint.

You say you start app B and then attach to B.exe. If B.exe is the application being started in the first place then Visual Studio will not allow you to select B.exe again, as it is already being debugged.

Later, you say you "go to app A" and put a breakpint. But in your story I don't see any moment where app A is running and/or attached. Might that be the cause of your problem?

-- Abel --


0
 
abelCommented:
Ah, maybe GiftsonDJohn understood your story better ;)
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
KerauAuthor Commented:
Thanks both of you will get back with follow-up asap
0
 
KerauAuthor Commented:
Giftson both the apps are on my local machine. So your other option for remote server is eliminated. the first option explains as how to attach to a process. Sorry for the confusion but ultimatelyt i need to bebug the code which lies in app a from app b by attaching the process...

hummm Abel ..you are close to what i am looking at here...Lets give them a real name as i have know how to attach the process. I have seen people taking out the sql statments by attaching to process.

There are two web apps Crystal and Person, Crystal is the one which hold GUI's of five different app. Person is the one i am working on. Since Person doesn't have a GUI, i have rely on Crystal to test my changes. Whenever i make a change in person app, after hitting debug will yeild me a dll which i copy+paste it in the external assembly of Crystal app and test my changes. Now i really need to debug this ..for this to happen i have to somehow attach to process the Person app to Crystal app correct?

Now to your statements:
Your breakpoint will only be hit if your Person.exe is build with debugging enabled.

>>>Yes it is build with debugging enabled. Or if something needs to be taken care of to make sure that it is debugging enalble please suggest.

Attach to process does not mean that you attach appl A to appl B. It means that the executable that you pointed to (Crystsal.exe) is attached to the debugger. If there are debugging symbols and/or information, the debugger can use that to locate the points in the code, or hit a breakpoint.

>>>Right now it doesn't

You say you start app B and then attach to B.exe. If B.exe is the application being started in the first place then Visual Studio will not allow you to select B.exe again, as it is already being debugged.

>>>No, on crystal app i hit debug [small green triangle](which should take me to person's app default page i.e. default.aspx.. as i have set this as my start page..p.s. all my GUI for person is in Crystal)>>go to debug menu>>attach Person appl's exe. By this time i already have put in a break point in person's appl or i can do it right now>>since the break point will not be on default.aspx>>Put a breakpoint on search.aspx in Person app.

Yes! person applis running as well>>from default.aspx; i go to search.aspx>>include my parameters to search >>>"I want the breakpoint to work here">>and on Crystal app the pages being created in person's app should appear on Crystal app becuase i am using a dll which has all the information.

But this is not happeing. What eventually happens is i get my results ...without them being debugged..please help...

0
 
KerauAuthor Commented:
You both are correct, i was the one with a wrong impression that we attach application A to B ..thanks Abel for clarifying that
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now