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><No description available></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/
– Danilo Oliveira
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?
– Igor Monteiro
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
– Danilo Oliveira
Igor, do you want to add an icon or image to all projects? You can illustrate this better, please?
– egomesbrandao
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.
– Igor Monteiro
this image above is only the icon that is shown in the template.
– Igor Monteiro
I think the best would be to create an extension of the visual studio to do this.
– AndrePassos
the template is already a kind of extension..
– Igor Monteiro
I mean an extension of type Vspackage. ex:https://msdn.microsoft.com/en-us/library/hh966591.aspx
– AndrePassos