Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / May 2006

Tip: Looking for answers? Try searching our database.

Macro to run a project by name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bilaribilari@yahoo.com - 22 May 2006 04:46 GMT
Hello all,
I have a huge list of projects in the Solution Explorer in VS.NET.
There are some projects that are used to create an environment for the
main project to run. This main project has been set as the default. So
I can press F5 to run it. However, I want to write a macro for one
other project since the list is quite huge and I have to scroll down
everytime, right-click on it, select 'Debug' and then click 'New
instance'. I could sure use some automation here.
Is there any way to do this in VS.NET using macros?

Thanks in advance for your time.
bilaribilari@yahoo.com - 22 May 2006 08:38 GMT
Its ok. I figured it out myself. Here it is for someone else who may
need similar functionality:

Sub DebugApp ( ByVal name As String, ByVal currActive As String )
{
'Set the named project as curr active project and run it. Then we'll
restore it.
 DTE.ExecuteCommand("View.SolutionExplorer")
DTE.ActiveWindow.Object.GetItem(name).Select(vsUISelectionType.vsUISelectionTypeSelect)
 DTE.ExecuteCommand("Project.SetasStartUpProject")
 DTE.Debugger.Go()

 'Restore the current active project to the same value as it was
previously.
 DTE.ExecuteCommand("View.SolutionExplorer")
DTE.ActiveWindow.Object.GetItem(currActive).Select(vsUISelectionType.vsUISelectionTypeSelect)
 DTE.ExecuteCommand("Project.SetasStartUpProject")

}

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.