Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the Visual Studio template file just a regular .zip file or is it something else?

I'm trying to tweak a project template file exported by Visual Studio's "Export Template" wizard. At first glance this looks like just a garden-variety zip file, but it's not:

  1. I can't edit files. If I try to change or delete or replace a file in the zip archive, I get The Compressed (zipped) Folder is invalid or corrupted.
  2. If I uncompress and recompress the zip file, Visual Studio no longer recognizes it as a template.

Is this something specific to my setup, or is there something non-standard about the zip format used by Visual Studio templates?


Edit I tried again and actually #2 above isn't true - I can un-zip, edit, and re-zip and VS sees the template. Still stumped as to why I couldn't manipulate the original archive directly, but I'm moving on.

like image 460
Herb Caudill Avatar asked Mar 10 '10 17:03

Herb Caudill


People also ask

What is Visual Studio template?

Visual Studio templates Item templates, such as code files, XML files, HTML pages, and Style Sheets, appear in the Add New Item window. These templates provide a starting point for users to begin creating projects, or to expand existing projects.

How do I import a Visual Studio template?

The default location is %USERPROFILE%\Documents\Visual Studio <version>\My Exported Templates. If you did not select the option Automatically import the template into Visual Studio in the Export Template Wizard, locate the exported template. Then, copy it to the user item template directory.

Where are Visual Studio project templates stored?

By default, templates installed with Visual Studio are located in: %ProgramFiles(x86)%\Microsoft Visual Studio\2019\<edition>\Common7\IDE\ProjectTemplates\<Language>\<Locale ID> %ProgramFiles(x86)%\Microsoft Visual Studio\2019\<edition>\Common7\IDE\ItemTemplates\<Language>\<Locale ID>

How do I create a Visual Studio template?

Go to Documents\Visual Studio Version\Templates\ProjectTemplates and create a new folder to separate your template from the default templates of visual studio. You will see the newly created template as shown below. Give the name of the project and click on 'Ok' button.


2 Answers

Solution is here to find: Exported Project Template from VS2008 but it is corrupted? In short: don't zip the directory, go into the directory, select all files and zip them into an archive.

like image 90
Jojo.Lechelt Avatar answered Jan 26 '23 19:01

Jojo.Lechelt


Visual Studio templates use the standard ZIP`ing format. I've succesfully compressed and uncompressed these files many times in the past.

What ZIP tool are you using?

like image 21
JaredPar Avatar answered Jan 26 '23 19:01

JaredPar