Remove System.Data and System.XML permanently (Visual Studio 2005)

In VS2005, whenever a class is added to a project then references to System.dll, System.Data.dll, and System.XML.dll are added automatically.  This can certainly be frustrating if you are trying to keep the set of unused references out of sight.

The solution I found was from

However, a simpler way would be to edit the ItemTemplatesCache instead. The .vstemplate file also contains the list of references to use when a new class is added to the project.  In order to change this behavior, simply do this:

  1. Go to the folder “%Program Files%\Microsoft Visual Studio 8\Common7\IDE\ItemTemplatesCache\CSharp\1033\”.
  2. Edit Class.vstemplate to show:

  3. In addition, you can also edit Class.cs to remove the headers.

When this is done, restart VS2005. The Add | Class… item template will no longer add a reference to System.Data.dll or System.Xml.dll to your project. Neither will the redundant headers show.

Leave a Reply

Your email address will not be published. Required fields are marked *