简体   繁体   中英

How to add a Setup project through Visual Studio DTE?

I am trying to develop a template Visual Studio 2008 solution making use of the IWizard interface. So far I have been able to successfully add multiple projects to the solution. I am now looking to put in a Web Setup project into the solution which will already have the Project Output from a particular project specified.

I read that a .vdproj file cannot be part of a template, so looking at any other alternate options available.

One option that I tried but did not work was to save the contents of the .vdproj file within the wizard and write it out after the solution gets generated. I am wondering if I can use the Visual Studio ExecuteCommand to add a Project and add the Output Group in the setup project without displaying the UI.

Anyone tried this before?

I found the answer.

The method of saving the contents of the .vdproj file within the wizard works. However, before writing out the content to a file and adding it as a project, the GUID of the project which would be used in the Setup project ( Project Output or Content Files ) has to be replaced in the saved text.

Visual Studio adds a unique project GUID once the project gets added to the solution, and this GUID has to be read using the Visual Studio SDK and replaced in the actual .vdproj file text.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM