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
Re: Remove Microsoft.Visual basic namespace from projects...?
Re: Remove Microsoft.Visual basic namespace from projects...?
Cheers. But it doesn't really help that much.
Woof
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