Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Build Automation and DTE-Object
Hi

I have 2 questions and no answers....

1.
How can I get the Value of the $TargetName Macro (from the
project-properties) in the DTE.Object?

DTE.Solution.Solutionbuild.??????

2.
I want do build some Solutionions one after the other. Ok, I can make
a big Solution an insert all Solutions to build in it. But this way is
<censored>.

I want to open the first solution, build them, if build is ok, close,
open a new solution, and so on. So I wrote a macro to do this:

Imports EnvDTE
Imports System.Diagnostics

Public Module ScriptTest
Dim WithEvents bldevents As BuildEvents
Dim WithEvents solevents As SolutionEvents
Dim applicationObject As EnvDTE.DTE

Sub TestModal()
DTE.ExecuteCommand("View.ResourceView")
DTE.ExecuteCommand("View.SolutionExplorer")
DTE.ExecuteCommand("View.Output")

DTE.Solution.Open("FirstSolution.sln")
SetBuildEvent()
SetCloseEvent()
ScriptSetConfiguration("Release")
DTE.Solution.SolutionBuild.Build()
End Sub

private Sub NextSolution()
DTE.Solution.Open("SecondSolution.sln")
SetBuildEvent()
SetCloseEvent()
ScriptSetConfiguration("Release")
DTE.Solution.SolutionBuild.Build()
End Sub

Private Sub solevents_AfterClosing() Handles solevents.AfterClosing
NextSolution()
End Sub

Private Sub bldevents_OnBuildDone(ByVal Scope As
EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles
bldevents.OnBuildDone
DTE.Solution.Close()
End Sub

Private Sub ScriptSetConfiguration(ByVal ActiveConfig As String)
Dim sb As SolutionBuild
Dim config As SolutionConfiguration
Dim context As SolutionContext

sb = DTE.Solution.SolutionBuild
config = sb.ActiveConfiguration
For Each context In config.SolutionContexts
context.ConfigurationName = ActiveConfig
context.ShouldBuild = True
Next
DTE.Windows.Item(Constants.vsWindowKindOutput).Activate()
End Sub

Private Sub SetBuildEvent()
applicationObject = CType(Application, EnvDTE.DTE)
bldevents = CType(applicationObject.Events.BuildEvents,
EnvDTE.BuildEvents)
End Sub

Private Sub SetCloseEvent()
applicationObject = CType(Application, EnvDTE.DTE)
solevents = CType(applicationObject.Events.SolutionEvents,
EnvDTE.SolutionEvents)
End Sub
End Module


It works fine.......
for the first solution. If it has to open the Second Solution, the IDE
opens something, but not the whole SecondSolution (the menu
File->CloseSolution is grayed), only the Project is opend.

Is it not possible to open a new Solution, after closing a solution,
using Events?

I use Framework 1.1, Development Enviroment 2003

Michael

Report this thread to moderator Post Follow-up to this message
Old Post
Michael Engelmann
09-30-04 01:09 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Studio archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:38 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.