Add Class Wizard in Visual Studio 2005

In 2003 we were able to add new C# file templates to the C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\VC#Wizards\CSharpAddClassWiz that would allow us to have our developers add files with the same template and would create our NUnit testing file for us. How do we do the same in the new version of Visual Studio 2005

Thanks for your responses.

Amit Nayar



Answer this question

Add Class Wizard in Visual Studio 2005

  • Sealed

    I've written two tutorials on this that should answer your questions:

    The first tutorial shows you where the item templates are located for Visual Studio 2005. You can either modify existing templates or add new templates.

    http://davidhayden.com/blog/dave/archive/2005/11/05/2556.aspx

    The second tutorial talks about the Export Template Wizard located on the file menu of VS 2005. I am not sure if this is available in all versions of VS 2005.

    http://davidhayden.com/blog/dave/archive/2005/11/06/2558.aspx

    Regards,

    Dave



  • jpguest

    Thanks much for that reply, Dave. It is a good start. In 2003 Visual Studio we were easily able to create our custom C# class template and also create a file that would act as a template for our NUnit test driver class. Such that when a developer would create a new C# file there would also be a C# class file generated that would be a template for testing the new class the developer created. For example if you created a new class file called Dave.cs, we could also have a TestDave.cs file created that stubs our code for NUnit testing.

    I'll have to play with this and see how I can get 2 files to be created in a single File - Add New Item action. But your info is a great start to pointing me in the right direction. Thanks again. If you have any information on how to solve the problem I'm facing, I would welcome your continued input.

    Thanks,

    Amit Nayar


  • sa acc

    You can do all of this using the new vstemplate architecture. Check out this article which walks the user through several scenarios to build and use templates in VS 2005. http://msdn.microsoft.com/vstudio/default.aspx pull=/library/en-us/dnvs05/html/CreatStrtKt.asp

    Hope that's useful,

    -Prasadi



  • smsm_fcis

    It appears as though the VSTemplate stuff works for all languages except Visual C++.

    I'm trying to create a new item to appear in the "Add Class" list of templates -- for our project, we're going to create many classes that follow a certain patterns, and it would greatly accelerate things to be able to have all the standard stuff put in automatically.

    Thanks

    -- Andrew


  • Sushovan De

    Hi

    I want to do the same, did you find a solution to create template class in visual C++

    thanks


  • Add Class Wizard in Visual Studio 2005