0 out of 4 rated this helpful - Rate this topic

Project Interface

Represents a project in the integrated development environment (IDE).

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

[GuidAttribute("866311E6-C887-4143-9833-645F5B93F6F1")] 
public interface Project
/** @attribute GuidAttribute("866311E6-C887-4143-9833-645F5B93F6F1") */ 
public interface Project
GuidAttribute("866311E6-C887-4143-9833-645F5B93F6F1") 
public interface Project

Every project in the solution has a project automation interface. In rare cases, this is a generic, unmodeled project implementation that returns the project's name.

Every tool in the environment that has a project has a Project object.

Reference this object by using DTE.Solution.Item or by using a specific language's objects, such as DTE.VBProjects.Item, or DTE.VCProjects.Item.

Sub ProjectExample()
' This function creates a solution and adds a Visual Basic Console
' project to it. 
   Dim soln As Solution2
   Dim proj As Project
   Dim msg As String
' Create a reference to the solution.
   soln = DTE.Solution
' Create a new solution.
   soln.Create("c:\temp2", "MyNewSolution")
' Create a new Visual Basic Console application project. 
' Adjust the save path as needed.
   Dim fileN As String
   fileN = soln.GetProjectTemplate("ConsoleApplication.zip", "VisualBasic")
   proj = soln.AddFromTemplate(fileN, "c:\temp2", "My New Project", True)
   
' Save the new solution
   soln.SaveAs("c:\temp2\newsolution.sln")
   msg = "Created new solution: " & soln.FullName
   MsgBox(msg)
End Sub
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
entire SDK is worhless
here are a few bugs within the SDK
1. I can't tell the difference between the IDE your writing you addin or package in my case. when I try to create a solution by code, I have to look for the correct IDE to attach to in Taskmanager.
2. ' VS2005 encountered an error' which error? 'vs encountered an error in VS2005' great description? Who the *** invented this under VISTA :(
3. GetProjectTemplate doesn't recognize all the project template paths (see error above)
4. The zip files aren't real zip files, just directories with the extention .zip(another retards mistake)
5. this reports an error see point 2(great for debugging again)
6. project kind is a string, where are the possible values listed? apparently nowhere (again a rookie mistake, there isn't even a link in MSDN to the values)
7. all examples listen in MSDN aren't even realisitic, some work but are so ***ing simple any idiot can use them (ie. Hello world is the most popular text, class, type, whatever)
Advertisement