Click here to Skip to main content
Click here to Skip to main content

Attach Debugger to NUnit using Macro

By , 4 Jul 2008
 

Introduction

If you have ever felt bored of wasting time opening Debug -> Attach of Visual Studio to attach to NUnit GUI application for debugging, then this macro is for you.

Background

No background is required.

Using the Code

First, download MsacroAttachNUnit.zip and extract the file Debug.vb inside this zip to your local drive.

Next, open Macros IDE by either going to menu Tools -> Macros -> Macros IDE or pressing Alt + F11.

After the IDE is open, in its Project Explorer Windows, right click on MyMacros and choose Add -> Add Existing Item. Then point the file browser to file Debug.vb.

Now, close the Macros IDE and open the Macros Explorer by either going to menu Tools -> Macros -> Macro Explorer or pressing Alt + F8. There is a macro named DebugNunit under MyMacros.Debug.

From now on, you can run the macro by double clicking on it in Macro Explorer to attach to NUnit GUI application. In order to make life a little bit easier, we can create a toolbar button for this macro. All the things you need to do is right click on your toolbar and choose Customize, then browse to command MyMacros.Debug.DebugNunit as in the figure shown below:

MacroAttachNUnit

Drag the command to anywhere most suitable for you and forget about all macro things. Just click the button whenever you want to attach to NUnit GUI for debugging.

Points of Interest

There are no points of interest except trying to find some "solution" for your laziness:-).

History

  • 5th July, 2008: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

ntr9h
Software Developer (Senior)
Vietnam Vietnam
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralErrormemberHariPriya24 Apr '09 - 10:22 
I get "Invalid Index" msg, which location does the macro expects the nunit.exe to reside...
GeneralRe: Errormemberntr9h26 Apr '09 - 23:24 
Hi, the macro only expects that at least an instance of NUnit-Gui to be running. The error message tells that there is no instance of NUnit-Gui is running, if there are more than one instances of NUnit-Gui then the first instance would be attached.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 5 Jul 2008
Article Copyright 2008 by ntr9h
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid