Click here to Skip to main content
15,908,013 members
Articles / All Topics

Visual Studio: Setting Up The Current Project And Run

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
15 Apr 2010CPOL 8.5K   1  
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:

free hit counters
VB.NET
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.

License

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


Written By
Software Developer (Senior) Paulo Morgado
Portugal Portugal

Comments and Discussions

 
-- There are no messages in this forum --