This macro should get you started:
Public Sub CopyProjectReferences()
Dim sSourceProject As String
Dim objProject As Project
Dim objSourceProject As Project
Dim objVSProject As VSLangProj.VSProject
Dim objVSSourceProject As VSLangProj.VSProject
Dim objReference As VSLangProj.Reference
Try
sSourceProject = InputBox("Filename (ex: " &
DTE.Solution.Projects.Item(1).UniqueName & ") source project to copy
references?")
objSourceProject = DTE.Solution.Projects.Item(sSourceProject)
objVSSourceProject = DirectCast(objSourceProject.Object,
VSLangProj.VSProject)
For Each objProject In DTE.Solution.Projects
' If it is not the source project to copy references
If objProject.Name <> objSourceProject.Name Then
objVSProject = DirectCast(objProject.Object,
VSLangProj.VSProject)
For Each objReference In objVSSourceProject.References
If
objVSProject.References.Find(objReference.Identity) Is Nothing Then
objVSProject.References.Add(objReference.Path)
End If
Next
End If
Next
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
--
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com "Ruslan Popov" <ruslan -at- triangularweb -dot- com> escribió en el mensaje
news:OamTxN0EFHA.624@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view] > Thanks. Can you give me some clue on such a macros?
>
> Had references been kept in some file, one would be able to copy them
> between projects.
>
> --
> Yours, respectfully
> Ruslan Popov
>