2

Does anyone know how I can stop Visual Studio 2005 adding references to the System.Data and System.XML assemblies every time I add a class to a c# project? It does not use any of them and I need to remove them everytime I notice.

Thanks.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Deanna
  • 23,876
  • 7
  • 71
  • 156

3 Answers3

4

That's because Class template contains such. To edit it, open:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache\CSharp\Code\1033\Class.zip
\Class.vstemplate

and remove unnecessary references.

To remove unnecessary namespaces, edit:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache\CSharp\Code\1033\Class.zip
\Class.cs
abatishchev
  • 98,240
  • 88
  • 296
  • 433
  • Thank you, I found that answer to this question too: http://stackoverflow.com/questions/2072687/how-do-i-edit-the-visual-studio-templates-for-new-c-class-interface – Deanna Jan 25 '11 at 17:12
1

Wouldn't this just be a case of altering the .cs template in Visual Studio and deleting the using statements you don't require? See here for more info:

http://msdn.microsoft.com/en-us/library/ms185319(v=vs.80).aspx

Mark Robinson
  • 13,128
  • 13
  • 63
  • 81
0

You need to edit vstemplage file

I think this is the same topic here How do I edit the Visual Studio templates for new C# class/interface?

Community
  • 1
  • 1
KBBWrite
  • 4,373
  • 2
  • 20
  • 22