Saturday, February 19, 2011

In Visual Studio 2008, how can I add a 'using blah.myblah;' to all new page codebehinds?

Is there a way to modify the default template for new pages so that it includes my custom 'using' statements?

From stackoverflow
  • From Steve's blog, it suggests that you edit the Class.cs file located in:

    %Program Files%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip
    

    Be sure to regenerate the template cache by running:

    %Program Files%\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe /setup
    

    Make sure you wait for the process to exit (watch your task manager!).


    Web templates are in a different zip:

    %Program Files%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web\1033\WebForm.zip
    

0 comments:

Post a Comment