Determine projects in solution within VS2005 macro

O

Oenone

I wish to create a macro (that runs within the BuildEvents_OnBuildDone
environment event IN VS2005) that loops through each of the projects in the
current solution and retrieves some details about each. At present I just
want to do something simple such as MsgBox each project's .vbproj
path/filename.

I've been unable so far to locate any reference material to help me figure
out how to do this.

Could anyone provide an example or a link to a good reference site that
would help me to achieve this?

Many thanks,
 
J

Jared Parsons [MSFT]

Hello Oenone,
I wish to create a macro (that runs within the BuildEvents_OnBuildDone
environment event IN VS2005) that loops through each of the projects
in the current solution and retrieves some details about each. At
present I just want to do something simple such as MsgBox each
project's .vbproj path/filename.

I've been unable so far to locate any reference material to help me
figure out how to do this.

Could anyone provide an example or a link to a good reference site
that would help me to achieve this?

Try this code out

Public Sub ShowFilePath(ByVal scope As EnvDTE.vsBuildScope, ByVal action
As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone
For Each project As EnvDTE.Project In DTE.Solution
Dim fileName As String = project.Properties.Item("FileName").Value
MessageBox.Show(fileName)
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top