Visual Studio is not seeing my altered templates - c#

So I am trying to create a multiple file template to using in visual studio 2010 C#.
I created an initial template using the visual studio export template wizard.
The problem I am having is when I extract the template and re-zip it visual studio no longer sees the template (note that I change nothing, I only unzip and zip)
Am I missing out a step or something?
Any help would be really appreciated.

Here is what you need to do:
Trick is, instead of selecting the folder which is unzipped, open the folder and then select all the files inside and then zip it. This should work well.

Related

Add custom Item Template to Visual Studio Solution

I have created a Custom Item Template within Visual Studio using ASPX and C#.
I understand how to export and import the template. However this gets saved locally within my PC's C:\ drive.
C:\Users[USERNAME]\Documents\Visual Studio 2017\Templates\ItemTemplates
I am wondering how i would attach it to the website's solution and make it accessible for whoever opens the solution on their PC. Without having to import or export it.
Any ideas?
I had the same problem ,you have to add the item template to Assets, in source.extension.vsixmanifest.
That should already work.

Visual Studio 2015 project fails adding to source control

i'm trying to use the functionality of the visual studio 2015 to create a project template.
I have a simple wcf-project with my special web.config. To use classes from another project i referenced it.
Those two projects are in the same solution and inherited in source control.
when i create the template and try to add a new project to the same solution, choose my custom template, the solution gets checked out but the files doens't get added to source control.
The source control says, that the binding is invalid. I dont know why.
Does anyone have any suggestions?
Thanks in advance!
Visual studio 2015 - Solution Explorer, Click Show all files,Check new file show in project tree. Right click on file select add to Project. New file need to add .sln (Project solution file) to show in project.
The project template gets added to project tree, but there no "+" sign in front of the file icons. and the solution file is checked out but no changes are made.

Resource Refactoring Tool for Visual Studio 2013

I was searching for a way to extract hardcoded string values to a resource file to be able to easily edit the string values and maybe create translation files...
I found a Addin : the Resource Refactoring Tool. But there is two problems :
It only works for Visual Studio 2012 and lower but I'm using the 2013 edition...
So I've searched for an updated version... and I found one (developped by a German) ! The new problem is that I fail to install it.
In the linked zip file on the previous website, there is a "HowTo - Install.txt" file which contains :
HowTo - Install
Copy all DLLs to "C:\Program Files (x86)\Power Toys for Visual Studio\Resource Refactor Tool"
Copy "ResourceRefactor.AddIn" to "C:\Users\<UserName>\AppData\Roaming\Microsoft\MSEnvShared\Addins"
(Re)Start Visual Studio.
At the 2. I've a problem because I don't have the destination folder (C:\Users\<UserName>\AppData\Roaming\Microsoft\MSEnvShared\Addins).
I've created the folder (useless or not ?) and I've done all the instructions, but it doesn't work.
I don't have "C:\Users\Drarig29\Documents\Visual Studio 2013\Addins" also.
Then I documented myself and I found this... I don't know what to do anymore.
Please help !
Regards, Drarig29.

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.

Any way to modify existing files in a Visual Studio Template?

I'm currently using a "New Item" template of mine to create several classes in my project based on the Name entered. What I'd like to be able to do, is to also add some lines to an existing file in the project. Is there any way to do this? Is there any way to run some sort of script from within the .vstemplate file?
For a vanilla item template in Visual Studio there is no way to achieve this. Item and Project templates just allow you to add new files to a project and allow for customizations of those files. But it's not possible to use them to change existing files.
You may be able to achieve what you're looking for though with a template wizard. This allows for the execution of arbitrary code during the processing of a template. You should be able to modify the existing files to your delight with this.
Tutorial Link: https://web.archive.org/web/20090625145715/http://blogs.msdn.com/vsxfaq/archive/2008/06/12/how-to-create-a-custom-template-wizard-using-visual-studio-2005.aspx
EDIT: Sorry, I misunderstood the question.
Original answer:
Well, the default templates are in 2 places:
\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplatesCache\CSharp\1033
\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033
You can change the template contents for new classes and new forms in there at your leisure... Not sure where user created templates are saved, but there's no reason you couldn't do the same thing to those (to my knowledge.)

Categories