开发者

TFS Custom Check-in Policy Debugging

开发者 https://www.devze.com 2023-01-16 21:31 出处:网络
I have created a custom check-in policy as given in the link below: http://msdn.microsoft.com/en-us/library/bb668980.aspx

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 开发者_JAVA百科debug? Kindly help me out.

Thanks in advance


While MrHinsh's method will in fact work I found that there is an even easier way to debug and would like to recommend that.

If you go to the properties of your checkin policy class project and look under the debug tab you will find a section for Start Action. Select to "Start external program" and browse to where you have visual studio installed.

for instance

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe

With this in place and the proper registry keys for loading the policy DLL from your debug folder all you need to do is hit Run and a second copy of VS 2010 will load up and you can debug your class without doing the Debug | Attach to process steps.


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..."

TFS Custom Check-in Policy Debugging


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).

TFS Custom Check-in Policy Debugging


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号