Hi All,
I am building a Visual Studio Addin in which inserting one menu under
tools window. When user clicked on this menu, a wizard window is shown
to take some inputs from user. At end of wizard, i want to create /
open a project in Visual Studio IDE.
To do this, i want to know following things :
1. How to open already existing project / solution file
programmatically?
DTE2 has openFile method. But msdn says that its for microsoft internal
only :(
There is also File.OpenProject command to open a project file (.vcproj,
.vbproj) but how to call this command in my OnConnection function of
connect class of addin?
2. To create new project, one can use GetProjectTemplate,
AddFromTemplate methods. But here i want to give all possible template
provided by visual studio IDE and added by user. In short i want to
show "customized" new project dialog box shown by choosing
File->new->project menu in IDE. Customization of this dialogbox will
involve setting location path, disabling browse button etc. ( i want to
allow user to create project in a specific directory)
Thanks in advance.
Regards,
Abhi
Carlos J. Quintero [VB MVP] - 16 May 2006 14:48 GMT
Hi Abhi,
> 1. How to open already existing project / solution file programmatically?
Use applicationObject.Solution.Open(solutionFileName) where
applicationObject is your EnvDTE.DTE object. If there is a solution loaded
(Solution.IsOpen returns true) you may want to prompt to save changes using
applicationObject.ItemOperations.PromptToSave.
> 2. To create new project, one can use GetProjectTemplate,
> AddFromTemplate methods. But here i want to give all possible template
[quoted text clipped - 3 lines]
> involve setting location path, disabling browse button etc. ( i want to
> allow user to create project in a specific directory)
AFAIK, this is not feasible, you may need your own "new project" menu and
your own dialog.

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com