tags:

views:

36

answers:

2

I have created a custom check-in policy as given in the link below:

http://msdn.microsoft.com/en-us/library/bb668980.aspx

I followed the steps as explained by the article. Everything works fine. My doubt is - Is it possible for me to debug the code while check-in the code?

Consider I want to know what are the methods are called inside the CheckForCommentsPolicy class as stated in article or I have added some business logic which needs to debugged. Which process do I have to attach? or Do I have to follow any other approach for debugging?

Is it possible to debug? Kindly help me out.

Thanks in advance

A: 

Yes. You need to have two copies of Visual Studio open. One had your solution open and the other for running the code.

You need to select "Debug | Attach to Process..."

Open the Attach to process dialog
Figure: Open the Attach to process dialog

You can then see all the available process on your computer and you should see the other instace of Visual Studio (this is the one you will use to run your checkin policy).

Attach to the devenv.exe process
Figure: Attach to the devenv.exe process

This will allow you to debug the instance of your Check-in Policy running in the copy of Visual Studio you just Attached to.

MrHinsh
Hi MrHinsh, Thanks for your comments. But I won't run the visual studio for running the check in policy tool. Actually it is a class library (.dll). This is registred in the windows registry. But my code will be somewhere else. In this case how can I debug it? Please let me know if you further details.. Thanks in advance!
Sathish
I got an idea from this link:http://stackoverflow.com/questions/2027698/how-to-debug-a-class-library-in-visual-studio
Sathish
A: 

I got the answer: http://msdn.microsoft.com/en-us/magazine/cc163320.aspx#S3

Sathish