How do I modify the built-in templates in VS2005?

A

Alan Silver

Hello,

Is it possible to modify the templates that come with VS2005? I have
searched all over the place, but can't find them anywhere. I know I can
make my own, but I would like to know if I can modify the ones that are
already there.

TIA
 
J

Juan T. Llibre

re:
!> Is it possible to modify the templates that come with VS2005?

VS 2005 has over 100 types of templates.

Which VS 2005 template do you want to modify ?

If you mean project templates, they're located in :

drive:\VSInstallDirectory\Common7\IDE\ProjectTemplates

If you mean web project templates, they're at :
drive:\VSInstallDirectory\Common7\IDE\ProjectTemplates\Web




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
A

Alan Silver

Juan T. Llibre said:
re:
!> Is it possible to modify the templates that come with VS2005?

VS 2005 has over 100 types of templates.

Which VS 2005 template do you want to modify ?

Sorry, forgot to mention. I specifically want to modify the templates
for a new web form when using C#.
If you mean project templates, they're located in :

drive:\VSInstallDirectory\Common7\IDE\ProjectTemplates

If you mean web project templates, they're at :
drive:\VSInstallDirectory\Common7\IDE\ProjectTemplates\Web

I actually meant a specific item template, which I found in...

C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\ItemTemplates\Web\CSharp\1033

In that folder were some zip files with the item templates inside. I
unzipped WebForm.zip and modified the files inside, then zipped it back
up again. However, when I created a new web form from VS2005, I got the
same old template as before.

I tried modifying other templates as well, but none of my changes showed
up.

Any idea what I did wrong? Thanks for the reply.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
L

Laurent Bugnion, MVP

Hi,

Alan said:
I actually meant a specific item template, which I found in...

C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\ItemTemplates\Web\CSharp\1033

In that folder were some zip files with the item templates inside. I
unzipped WebForm.zip and modified the files inside, then zipped it back
up again. However, when I created a new web form from VS2005, I got the
same old template as before.

I tried modifying other templates as well, but none of my changes showed
up.

Any idea what I did wrong? Thanks for the reply.

VS loads the templates in a temp folder, and opens them from there. If
you want to modify an existing, already loaded template, it's not easy
because you have to localize all the temp copies.

I rather recommend you to create a new template based on the one you
want to modify. Simply create a new project, add or modify the files
like you need, and then choose the menu File / Export template. During
the export, there is an option to automatically import the newly created
template in your version of VS2005.

HTH,
Laurent
 
A

Alan Silver

"Laurent Bugnion said:

Hello,

VS loads the templates in a temp folder, and opens them from there. If
you want to modify an existing, already loaded template, it's not easy
because you have to localize all the temp copies.

So when does it ever use the files in the templates folder? Seems
pointless having them if it uses the ones in the temp folder.

Also, what happens if I delete the temp folders? Won't it just recreate
them from the files in the templates folder, including the ones I
modified?

This all seems rather complex and convoluted. I'm sure there's a good
reason for it, but I can't see what!
I rather recommend you to create a new template based on the one you
want to modify. Simply create a new project, add or modify the files
like you need, and then choose the menu File / Export template. During
the export, there is an option to automatically import the newly
created template in your version of VS2005.

Phew, what a pain! Why can't I just modify the template supplied? This
seems like a very messy way to do it. All I want to do is change the
doctype!

Thanks for the reply
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top