0

I woulkd like to create a Visual Studio extension. I chose the Package option since the AddIn option will be deprecated from Visual Studio 2013 and above.

So i installed Visual Studio 2012, and Visual Studio SDK 2012, and created a new VS Package project.

Now, I want my package to enable the user to create a new type of project. i.e: I want to extend the right click->new project options to contain a new model of project, which will be a standard Visual C++ project, with some additional configurations, links, references and etc.

I googled a lot, but found nothing.

Does any of you have an idea about this target?

Thanks in advance!

Matze
  • 5,100
  • 6
  • 46
  • 69
user1835297
  • 1,059
  • 2
  • 12
  • 24

1 Answers1

1

I think the Visual Studio Template Schema Reference contains all information you need to create custom project templates; see: http://msdn.microsoft.com/en-us/library/xwkxbww4.aspx

You can derive a project template from an existing project, which might be the way to go, since it creates a valid template that only needs some customizing. A template export can be done by using the Export Template command found in the File menu.

The template wizard will create a ZIP file containing the template manifest and all referenced files; just extract the archive and customize it in the way you want it (add/remove files, change information like name and description in the manifest). Once you´ve your customized template, create a new VISX package project and add the template ZIP file to it (using Add Existing Item command).

The last step will be to add an Asset to the VISX manifest. Open the source.extension.vsixmanifest file in the VSIX designer, goto the Assets tab and click the New button; this will open a dialog to setup the asset... choose Microsoft.VisualStudio.ProjectTemplate as the type - and File on filesystem as the source. This will allow you to pick the previously added ZIP file. Build the package - and you´re done.

Matze
  • 5,100
  • 6
  • 46
  • 69
  • Hi @Matze, thanks for your response! I will explain more detailed what I have to do: I'ld like to have an extension, which: enables the user to create a new project from a new type(i.e.: from new project template, with specific dependencies and other definitions). on the new project creation I'ld like to import an existing solution and locate the new project in a specific folder of this solution. Do you know about a way to write code like this on creation of a new project of the new template? Do I have any event/other handler on the template code,or in the whole package code, which I can use? – user1835297 Mar 30 '14 at 08:16
  • A wizard implementation might be suitable; see: http://msdn.microsoft.com/en-us/library/ms171411.aspx and: http://msdn.microsoft.com/en-us/library/ms185301.aspx. I would suggest to open another question, since it is a complete different problem... – Matze Mar 30 '14 at 08:53
  • done: https://stackoverflow.com/questions/22744216/vs-extension-which-declares-a-new-project-template-and-locate-the-generated-proj – user1835297 Mar 30 '14 at 12:52
  • Hi @Matze, I tried using the template wizard. It really has the RunStarted methode which is called on the project creation, but there are no many options there... I'm trying to change the new project destination directory and solution, but didn't succeed. I'ld like to know:if I'll return to the simple template+package option, Don't I have any way to write code which will be called on the project creation and will be able to chenge the project parent solution and etc.? I think that in the future I'll need more functionality that is available only in the package option, so I prefer to return... – user1835297 Apr 03 '14 at 09:24