Create item in another project Visual studio 2013 Template

Asked

Viewed 320 times

3

I am creating a template in visual studio, but I want to add an item in a project to be created in all other projects of Solution, can anyone help me? the code is more or less this:

<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
      <TemplateData>
        <DefaultName>WebApiConsulta.cs</DefaultName>
        <Name>WebApiConsulta</Name>
        <Description>&lt;No description available&gt;</Description>
        <ProjectType>CSharp</ProjectType>
        <SortOrder>10</SortOrder>
        <Icon>__TemplateIcon.png</Icon>
      </TemplateData>
      <TemplateContent>
        <References />
        <ProjectItem SubType="Code" TargetFileName="Projeto1/$fileinputname$.cs" ReplaceParameters="true">ConsultaGrupoProjeto.cs</ProjectItem>
   <ProjectItem SubType="Code" TargetFileName="Projeto2/$fileinputname$.cs" ReplaceParameters="true">ConsultaGrupoProjeto.cs</ProjectItem>
   <ProjectItem SubType="Code" TargetFileName="Projeto3/$fileinputname$.cs" ReplaceParameters="true">ConsultaGrupoProjeto.cs</ProjectItem>
      </TemplateContent>
    </VSTemplate>
  • Nuget is a good tool to do this job, from a read https://www.nuget.org/

  • I think you got confused friend, the nuget contains a series of "plugins" pro visual studio.. vc knows the name of this that you indicated me?

  • You can create your own bundle with Nuget and add it to all your projects, always when you upgrade Nuget will update all your projects.. Read

  • Igor, do you want to add an icon or image to all projects? You can illustrate this better, please?

  • hi Big thanks for the message, actually I want to include a standard file to be used as "template" for the developers here on my team. The visual studio gives the option to export item and project, when the exported project is used, creating a standard "project". When it is an item it can create a series of files in the same project. my intention that even with the projects already created I can "walk" between the projects and include my template in each specific folder of each project. looks complex but it’s simple and my team would gain a good time in production.

  • this image above is only the icon that is shown in the template.

  • I think the best would be to create an extension of the visual studio to do this.

  • the template is already a kind of extension..

  • I mean an extension of type Vspackage. ex:https://msdn.microsoft.com/en-us/library/hh966591.aspx

Show 4 more comments

1 answer

1


  • It really helps, I left her a message when I found her blog about three months ago. The option I had for this problem was to fazwer a template for each project. before I used macros but the visual studio 2013 does not allow more macros. Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.