Results 1 to 4 of 4

Thread: Remove Microsoft.Visual basic namespace from projects...?

  1. #1

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Remove Microsoft.Visual basic namespace from projects...?

    Every project I create in .NET automatically imports the Microsoft.VisualBasic namespace.
    this is bad practice, and I don't like doing it, so I remove this whenever I create a new project.
    This however is very tenedious and annoying.
    How can I get .NET never to add this namespace into new projects?

    Woof

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Remove Microsoft.Visual basic namespace from projects...?


  3. #3

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: Remove Microsoft.Visual basic namespace from projects...?

    Everytime you create a new project, you are actually invoking the VS automation engine. What then happens is it loads and executes a script file (javascript no less), which operates on a default template.

    What you need to do is open up the templates, and remove or add lines as you see fit. For your particular situation, there are two places to remove this.

    For visual studio 2003:

    1) Close down VS.
    2) Go to C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\VBProjects folder
    3) Open up the EmptyWebProject.VBPROJ file with Notepad.
    4) Delete the VB namespace from the Imports section...
    5) Save the file.
    Code:
    <VisualStudioProject>
        <VisualBasic>
            <Build>
    	    <Settings
    		OutputType = "Library"
                    StartupObject = ""
                    DefaultHTMLPageLayout = "Flow"
                    DefaultTargetSchema = "IE32Nav30"
                >
                    <Config
                        Name = "Debug"
                        DebugSymbols = "true"
                        DefineDebug = "true"
                        DefineTrace = "true"
                        IncrementalBuild = "true"
                        OutputPath = "bin"
                    />
                    <Config
                        Name = "Release"
                        DebugSymbols = "false"
                        DefineDebug = "false"
                        DefineTrace = "true"
                        IncrementalBuild = "false"
                        Optimize = "true"
                        OutputPath = "bin"
                    />
    	    </Settings>
                <Imports>
                    <Import Namespace = "Microsoft.VisualBasic" />'REMOVE THIS 
                    <Import Namespace = "System" />
                </Imports>
            </Build>
            <Files>
                <Include>
                </Include>
            </Files>
        </VisualBasic>
    </VisualStudioProject>

    6) Then, browse to the 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\VBWizards\WebApplication\Templates\1033' folder.

    7) Open the WebApplication.VBPROJ file with NotePad and do the same....then save the file.

    Restart VS, and create a new empty web, and viola, no vb namespace import.

    Don't forget to mention I'm the man when you thank me.

    Also, if you want to create web pages from now on that include the W3C mandated 'loose' doctype... see my previos post on the subject here :
    http://www.vbforums.com/showthread.p...hlight=doctype
    Last edited by nemaroller; Jul 15th, 2005 at 09:15 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width