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 / Extensibility / January 2006

Tip: Looking for answers? Try searching our database.

BuildProject method fails with "Unspecified error"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Troy R - 14 Dec 2005 19:00 GMT
Hi,
 I can't seem to get the following macro to work:

   Sub BuildProject()
       DTE.Solution.Create("C:\\", "MyTestSolution")
       DTE.Solution.SaveAs("C:\\MyTestSolution")
       DTE.Solution.AddFromFile("C:\\test.vcproj")
       DTE.Solution.AddFromFile("C:\\anothertest.vcproj")

       If (DTE.Solution.Projects.Count > 1) Then
           Dim myproj As EnvDTE.Project
           myproj = DTE.Solution.Projects.Item(1)
           If Not (myproj Is Nothing) Then
               DTE.Solution.SolutionBuild.ActiveConfiguration.Activate()
               
DTE.Solution.SolutionBuild.BuildProject(DTE.Solution.SolutionBuild.ActiveConfiguration.Name, myproj.Name, False)
           End If
       End If
   End Sub

 I can confirm that the ActiveConfiguration name in this case does exist so
it shouldn't fail.
Mirko Matytschak - 10 Jan 2006 16:07 GMT
I'm not shure, but I think the index must be zero:

myproj = DTE.Solution.Projects.Item(0)

Mirko

>             myproj = DTE.Solution.Projects.Item(1)
Dustin Campbell - 10 Jan 2006 17:56 GMT
Actually, collections in Visual Studio automation are 1-based because they
were originally designed to be used with VBA.

-----
Best Regards,
Dustin Campbell
Developer Express Inc

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.