Questions tagged [visual-studio-templates]

A number of predefined project and project item templates are installed when you install Visual Studio.

These templates appear as project types in the New Project Dialog Box.You can use one of the many project templates to create the basic project container and a preliminary set of items for your application, class, control, or library. You can also use one of the many project item templates to create, for example, a Windows Forms application or a Web Forms page to customize as you develop your application.

237 questions
5
votes
1 answer

What is the best way to include references to my own assemblies in a project template?

We have developed a library in C#, and now I wish to create a project template to aid in using the library correctly. I want new projects to include a reference to the library assembly, but would prefer not to have to deploy the assembly to the GAC,…
5
votes
2 answers

Visual Studio 2012 project template custom params & renaming issues

Task: I want to create a project template from a Visual Studio 2012 project, so I can quickly create similar projects. This requires files to be renamed and the root namespace to be changed. Unfortunately, this does not happen... What has been…
Knots
  • 551
  • 8
  • 19
5
votes
3 answers

Double slash // in paths - can I use single slash?

I have a VS template with something like string mypath = "C:\\custom\\file.jpg"; I'd like to make the C:\custom\ part with a template substitution parameter $userpath$. Is there any way I can avoid using double slashes? What I'd like to write…
Marco A.
  • 43,032
  • 26
  • 132
  • 246
5
votes
1 answer

Is there a way to specify the initial cursor position in a Visual Studio item template?

When you add, for example, a class to a project by selecting Add > New Item > Visual C# Items > Class, the blinking text cursor inside the new class will be at row 1, column 1. Is there a way to modify the template so that the blinking cursor…
T Graham
  • 1,329
  • 10
  • 14
4
votes
2 answers

VisualStudio Multi project Templates

I am creating a Multi project Template The problem is that when I run the template each project creates a directory folder that matches the project name. I don't want each of the projects creating folders by default, like…
4
votes
1 answer

Group Items in Itemtemplate

If this question is already answered, please point me to the correct answer. I haven't found a similar question here. I have created an Itemtemplate with two files, which need grouping after adding them to a project. Is it possible to add an…
4
votes
2 answers

Change "Implement interface" template in Visual Studio

I'm constantly using the "Implement interface" shortcut in Visual Studio 2008. My "problem" is that i want Visual Studio to use the String-alias instead of string in every instance. Since i'm forced to use String instead of string this would save…
alexn
  • 57,867
  • 14
  • 111
  • 145
4
votes
2 answers

Use local IWizard assembly as WizardExtension in Project Template

I have a very simple IWizard implementation with sole the purpose of adding a parameter variable to the dictionary (no user interaction is required). I don't want to have to add this to the GAC if possible. I placed the dll in the root of the…
4
votes
2 answers

Adding custom format to a template parameters Visual studio project

I have defined a Visual Studio template called classDB.cs. I would like the default name for the class to appear as [projectname]DB.cs, where [projectname] is the name of the current project (as entered in the Create Project dialog). Is there a…
Jorge
  • 17,896
  • 19
  • 80
  • 126
4
votes
2 answers

Install NuGet packages automatically in VS 2010 project template

Can anyone share with me how to (or where I can find how to) install NuGet packages automatically when I create a new project based on my custom project template in Visual Studio 2010? I am creating a new project template for a project that uses a…
4
votes
0 answers

How can I declare and enable template parameters (Multi-Project Template)

I'm creating a multi-project template that has a solution as the root folder. I can't find out how to include the name of the solution in the namespace of the project. $safeprojectname$ returns the name of the internal project of the…
4
votes
1 answer

Correct way to use MSBuild Task that generates code with Intellisense

Context For some project, we've been attempting to do code generation directly from Visual Studio. The basic idea is that you can create a bunch of (.foo) files, and that each (.foo) file corresponds to a single generated (.foo.cs) file. Basically…
atlaste
  • 30,418
  • 3
  • 57
  • 87
4
votes
1 answer

Visual Studio Custom Template Category has an extra folder

I have created an ItemTemplate project. I would like to install this to a custom folder. This works fine when I manually add the zip file built from the project to my named folder inside ItemTemplates. I am now using two projects, the original…
Reznoir
  • 909
  • 1
  • 11
  • 27
4
votes
2 answers

Interop type 'ProjectKinds' cannot be embedded. Use the applicable interface instead

I´m developing a visual studio extension, but unfortally I can´t check the project kind , please look de follow code: if (project.Kind == EnvDTE80.ProjectKinds.vsProjectKindSolutionFolder) { …
Igor Monteiro
  • 933
  • 1
  • 11
  • 29
4
votes
1 answer

Azure Service Fabric SDK 2.6.210 Missing Stateless Web API Template on Visual Studio 2017?

I installed the latest 2.6.210 SDK / 5.6.210 Runtime for Service Fabric on my development PC using Visual Studio 2017 and now when I choose to create a new Cloud solution the "Stateless Web API" template is gone. I've also noticed that the…
1 2
3
15 16