Paulo Morgado

.NET Development & Architecture

Recent Articles

view all

Events

Projects

Recent Readers

Visitor Locations

Visitor Locations

Disclaimer

The opinions and viewpoints expressed in this site are mine and do not necessarily reflect those of Microsoft, my employer or any community that I belong to. Any code or opinions are offered as is. Products or services mentioned are purchased by me, made available to me by my employer or the manufacturer/vendor which doesn't influence my opinion in any way.

Visual Studio: Setting Up The Current Project And Run

When I’m building a demo solution I usually have several projects to demo different features.

When I want to run one of the projects, I have to set it as the startup project (either in the Project menu or in the context menu of the Solution Explorer for the desired project) and start it with or without debugging.

I can start any project with debugging using the context menu for that project in the Solution Explorer, but I cannot start the project without debugging.

While preparing for my session at the upcoming Microsoft TechDays 2010, I decided to work around this by creating macros to set the current project as the startup project and start the project with or without debugging:

Sub SetAsStartUpProjectAndStartWithoutDebuggingMacro()
    DTE.ExecuteCommand("Project.SetasStartUpProject")
    DTE.ExecuteCommand("Debug.StartWithoutDebugging")
End Sub

Sub SetAsStartUpProjectAndStartWithDebuggingMacro()
    DTE.ExecuteCommand("Project.SetasStartUpProject")
    DTE.Debugger.Go(False)
End Sub

And I can bind those macros to keyboard shortcuts (Shift+Alt+F5 for starting with debugging and Ctrl+Shift+Alt+F5 for starting without debugging) and add them to a toolbar.

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)