Introduction to the VSProject2 Object
The VSProject2 object provides access to the Visual Basic and Visual C# project structure.
VSProject Properties and Methods
Following are the properties and methods specific to Visual Basic and Visual C#:
The Imports property contains a collection of all the project-level Imports statements in a Visual Basic project. Adding an Imports statement to this collection is equivalent to adding the same statement to each code file in the project. This property makes sense in a Visual Basic project only. For more information, see Imports.
The References property contains a collection of all references in a project. For more information, see References and Responding to Events (Visual Basic and Visual C# Projects).
The WebReferencesFolder property, which is a ProjectItem object, contains a collection of all Web references in the project in its ProjectItems property. You can use the CreateWebReferencesFolder method to create this project item and then add Web references by using the AddWebReference method.
The WorkOffline property is obsolete.
The TemplatePath property is deprecated for Microsoft Visual Studio 2005 and should not be used for project creation. To create new projects, use GetProjectItemTemplate instead.
To copy projects, use the CopyProject method.
The Refresh method updates Solution Explorer after changes are made to the project.
The BuildManager property provides access to the temporary portable executables needed to implement custom tools and designers. For more information, see Introduction to the BuildManager Object and BuildManager.
The VSProject2 object also has properties to help you work your way back to objects in the general extensibility model. These properties include:
The DTE property returns the top-level extensibility object. You have access to the entire Visual Studio extensibility object model through this property.
The Project property returns the general extensibility object for the project. This object includes properties, methods, and events that are common to all Visual Studio projects.
The following table provides links to topics that detail how to use the VSProject2 object to create and control Visual Basic and Visual C# projects.
To: |
See: |
---|---|
Create Visual C# and Visual Basic projects, use .zip-files to add project items, use the VSProject2 object to control the project. |
How to: Manipulate Visual Basic and C# Projects By Using the VSProject2 Object |
Create Visual Basic projects and use the Imports property to obtain a handle to the Imports object. |
How to: Manipulate the Imports Property of Visual Basic Projects |
See Also
Reference
Imports Statement (.NET Namespace and Type)