Attention: We are retiring the ASP.NET Community Blogs. Learn more >

I miss stdafx.h :)

In some way I miss stdafx.h when I have to add the using clauses in C# code, I often use the namespaces System, System.Text, System.Collections, System.Xml then I have to write the "usings" every time I create a new class.

Then I would like to have a global using section...

8 Comments

  • Couldn't you modify your templates for your classes to automatically include them for you? I personally haven't done this (or even know where they exist) but I would think this would be a feasible solution for the time being.

  • Yep, I modified in my machine you can modify



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



    The problem with this is that there are "usings" that depend on the project. For example in my current project I have to include "using MyCustomNamespace"

  • You can modify the template that creates the class...



    In my specific installation it's located at: C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\VC#Wizards\CSharpAddClassWiz\Templates\1033\NewCSharpFile.cs



    Modify the c:\program files\Microsoft Visual Studio .NET 2003 portion to reflect your own installation path.



    Hope this helps.

  • Wow - something that VB.NET does, and a C# user wants it?! I never thought I'd see the day. 8)



    in the project properties for a VB.NET project, you can add a global "Import", which is the equiv of C# Using for namespaces.

  • hehe... I was thinking the same thing. ;-)

  • Try posting this message on microsoft.public.dotnet.languages.csharp



  • Can we use the downloaded source code of stdafx.h

  • fantastic issues altogether, you simply won a logo new|a new} reader. What could you recommend about your post that you just made a few days in the past? Any positive?

Comments have been disabled for this content.