Changing the VS 2003 Templates

  • Thread starter Thread starter Greg Merideth
  • Start date Start date
G

Greg Merideth

Is it possible to change the default templates in VS 2003?

Everytime I start a new web method project I have to include a ton of
version control headers and region tags. It would be handy to be able
to alter the default templates to include all of this stuff so I don't
have to each time.

Thanks.
 
Greg,

Yes, it is possible. For VS.NET 2003, there is a directory under the
IDE that has a file, "Class1.cs". This file is a template that is used in
conjunction with other files (there is a common.js file which sets up
variables I believe) to generate the new files when you select new items.

Unfortunately, I can't remember where the directory is, as I've
uninstalled VS.NET 2003, in favor of VS.NET 2005. The structure is
different in VS.NET 2005, so I can't reference my current installation.

From what I remember, it would be under:

<Program Files>\Microsoft Visual Studio .NET 2003\VC#\CSharpProjectItems

And then there would be a directory with the Class1.cs file in there.

Hope this helps.
 
Found it, wasn't in the folder but it at least showed me where to look.

It's all the way down in:

<Program Files>\Microsoft Visual Studio .NET
2003\VC#\VC#Wizards\CSharpWebServiceWiz\Templates\1033

Thanks. This will save me many hours of cutting and pasting. I've got
some work ahead of me in the beta vs 2005, I'll check the folders in
there as well.

I figured something like this would be part of the VS environment to be
able to change the templates easily.
 
Greg,

In VS.NET 2005, I wouldn't recommend changing the templates in this
manner. There is a much more robust system which allows you to tweak and
modify your own types. There should be a few articles on this on MSDN on
how to do this.

Hope this helps.
 
Greg said:
Found it, wasn't in the folder but it at least showed me where to look.

It's all the way down in:
<snip>

I have added things to the template script files that also add a
timestamp to the file when added to the project. Let me know if you want
a copy of the code.
 
Back
Top