Sign in
|
Join
Search
brady gaster
yadnb
Home
Contact
About
RSS
Atom
Comments RSS
Recent Posts
Dragging User Controls in HTML View
Renaming (or not renaming) Objects in HTML Design View
Support Complaint
More Complaints {though not from me}
Empty GridView, Invisible Footer
Sponsors
advertise here
Tags
asp.net visual studio objectdatasource
bug asp.net Visual Studio objectdatasource gridview
complaints
Navigation
Home
Blogs
Links
e.j.smith
p.scott
r.howard
g.robinson
cory foy
Archives
November 2006 (1)
October 2006 (7)
September 2006 (2)
August 2005 (1)
July 2005 (2)
June 2005 (3)
May 2005 (4)
April 2005 (3)
June 2004 (5)
May 2004 (10)
April 2004 (9)
March 2004 (13)
February 2004 (6)
January 2004 (3)
December 2003 (11)
November 2003 (14)
October 2003 (2)
September 2003 (1)
August 2003 (9)
July 2003 (2)
June 2003 (6)
May 2003 (12)
Programmatically Adding References (Macro-related)
If the name of the post doesn't sum it all the way up, here's the question. Does anyone know of a way, in macro code, to programmatically add a reference to a project? That'd be swell, eh? Takers?
Posted:
Dec 31 2003, 01:12 PM
by
tatochip
| with
3 comment(s)
Comments
Matt Berther
said:
Isnt the project file just xml?
Just add <Reference Name="" AssemblyName="" HintPath=""/> elements to the References node.
#
December 31, 2003 2:25 PM
adam
said:
It's hidden in the VSLangProj.VSProject class.
Public Module Module1
Public Function AddProjectReference()
Dim selItems As EnvDTE.SelectedItems
selItems = DTE.SelectedItems
If selItems.Count = 1 Then
Dim project As Project
project = selItems.Item(0).Project
Dim vsProj As VSLangProj.VSProject
vsProj = DirectCast(project.Object, VSLangProj.VSProject)
vsProj.References.Add("path to reference")
End If
End Function
End Module
#
December 31, 2003 10:10 PM
brady gaster
said:
VERY nice indeed! Danke!
#
January 1, 2004 12:20 PM
Leave a Comment
Title
(required)
Name
(required)
Your URL
(optional
)
Comments
(required)
Remember Me?