zam6ak
zam6ak

Reputation: 7259

Is it possible to add QuickWatch Expression programatically when debugging in VS 2010?

While debugging I constantly find myself adding

System.Web.HttpContext.Current.Request

or similar to QuickWatch Expression (Shift+F9)...

Is there a way to do this in C# via code (some attribute or similar)?

Upvotes: 1

Views: 407

Answers (1)

Omer Raviv
Omer Raviv

Reputation: 11827

Here's a VS Macro that both adds the expression to the Watch window and open the QuickWatch window with it:

Sub WatchHttpRequest()
    DTE.ExecuteCommand("Debug.AddWatch",   "System.Web.HttpContext.Current.Request")
    DTE.ExecuteCommand("Debug.QuickWatch", "System.Web.HttpContext.Current.Request")
End Sub

Upvotes: 1

Related Questions