Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / May 2006

Tip: Looking for answers? Try searching our database.

How to open a project through Addin?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Abhi - 14 May 2006 06:56 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.