|
|
#1 |
|
Admodistrator
Join Date: Jan 05
Posts: 3,900
![]() ![]() |
Permanently turn off vb.namespace?
Is there a way to do so? Id just like to know that im coding in straight up vb.net without the hassle
Last edited by |2eM!x; Jan 21st, 2006 at 06:52 PM. |
|
|
|
|
|
#2 |
|
"The" RedHeadedLefty
Join Date: Aug 05
Location: College Station, TX Preferred Nickname: Gig Current Mood: Just Peachy Turnons: String Manipulation
Posts: 4,461
![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
Do you have that dll listed as a reference in your project?? Its not in any of mine, and I cant remember if that was an option I turned off or not.... In order to use any of those, I have to type out the namespace... "Microsoft.VisualBasic...etc..." If its listed as a reference, then just remove the reference...
|
|
|
|
|
|
#3 |
|
"The" RedHeadedLefty
Join Date: Aug 05
Location: College Station, TX Preferred Nickname: Gig Current Mood: Just Peachy Turnons: String Manipulation
Posts: 4,461
![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
You can go into your project properties (not solution properties), in the Common Properties folder, there should be an "Imports" node. Click on the node and you should see all of the Imports Statements for the project. Remove the Microsoft.VisualBasic imports statement and you should be good... (this is .NET 2003 directions)
|
|
|
|
|
|
#4 |
|
Admodistrator
Join Date: Jan 05
Posts: 3,900
![]() ![]() |
Re: Permanently turn off vb.namespace?
I know how to do it guys, but is it possible to auto remove it? Like how it auto adds option strict?
|
|
|
|
|
|
#5 |
|
.NUT
Join Date: May 05
Location: Sydney, Australia
Posts: 54,913
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
Why do you need to "turn it off"? Just don't use it. It's easy to know when you're using a Runtime function because they are all members of modules. That's how you can use them without qualification. If you use a function in VB.NET without qualifying it with a type or instance name and it doesn't turn blue then it's a Runtime function. This means that things like CInt, DirectCast, etc. are not Runtime functions. They turn blue because they are VB.NET keywords, i.e. part of the language itself. Things like Asc, Split, MsgBox are Runtime functions, easily identifiable because the function name doesn't require qualification but does not turn blue. Click the name and press F1 and the help topic will tell you which module they belong to, e.g. Microsoft.VisualBasic.Strings, Microsoft.VisualBasic.Interaction, etc.
__________________
![]() 2007, 2008, 2009, 2010 Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs MSDN "How Do I?" Videos: VB | C# VBForums Database Development FAQ My CodeBank Submissions: VB | C# (ForumAccount has translated some of my VB submissions to C#) My Blog: Defining and Raising Custom Events | Manipulating GDI+ Drawings | Using Parameters in ADO.NET |
|
|
|
|
|
#6 |
|
Super Moderator
Join Date: Apr 01
Location: LA, Calif. Raiders #1 AKA:Gangsta Yoda™
Posts: 58,668
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
You can also use the Object Browser to search for a function to see what is the fully qualified class name for it.
__________________
VB/Office Guru™ (AKA: Gangsta Yoda™ I dont answer coding questions via PM. Please post a thread in the appropriate forum. ![]() ![]() Microsoft MVP 2006, 2007, 2008, 2009, 2010 Office Development FAQ (VBA, VB 6, VB.NET, C#) Software Engineer MCP (VB 6 & .NET), BSEE, CET (Internet.com's #1 Poster) If a post has helped you then Please Rate it! • Star Wars Gangsta Rap • Reps & Rating Posts • VS.NET on Vista (New) • Multiple .NET Framework Versions (New) • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility • System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007 |
|
|
|
|
|
#7 |
|
ASP.NET Moderator
Join Date: Feb 02
Location: Ulaan Baator GooGoo: Frog
Posts: 37,385
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
If you can create a custom project template without the Microsoft.VisualBasic namespace on it, then you could use that and achieve the 'automatically turned off' feature you want.
|
|
|
|
|
|
#8 |
|
Frenzied Member
Join Date: Jul 02
Location: Dublin, Ireland
Posts: 1,721
![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
In your Program Files\Microsoft Visual Studio 2003\Common 7\VB7\VBProjects\ there is a file called "EmptyProject.vbproj"
This is an xml mile that defines your standard new project and it includes the imports section: Code:
<Imports>
<Import Namespace = "Microsoft.VisualBasic" />
<Import Namespace = "System" />
</Imports>
|
|
|
|
|
|
#9 |
|
Admodistrator
Join Date: Jan 05
Posts: 3,900
![]() ![]() |
Re: Permanently turn off vb.namespace?
Thanks man, great idea!!
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\VBExpress\ProjectTemplatesCache\1033\WindowsApplication.zip Is in the newest version
|
|
|
|
|
|
#10 |
|
.NUT
Join Date: May 05
Location: Sydney, Australia
Posts: 54,913
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
Note though that this is still just removing an Import. Every VB.NET app has an implicit reference to the Microsoft.VisualBasic.dll assembly. I guess removing the Import will mean that you would have to qualify all Runtime functions so you will not use any inadvertently. As I posted before though, it is quite simple to identify when you are using a Runtime function. What you do is up to you of course, and this will do no harm, but it seems to me to be a solution to a problem that doesn't exist.
__________________
![]() 2007, 2008, 2009, 2010 Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs MSDN "How Do I?" Videos: VB | C# VBForums Database Development FAQ My CodeBank Submissions: VB | C# (ForumAccount has translated some of my VB submissions to C#) My Blog: Defining and Raising Custom Events | Manipulating GDI+ Drawings | Using Parameters in ADO.NET |
|
|
|
|
|
#11 | |
|
ASP.NET Moderator
Join Date: Feb 02
Location: Ulaan Baator GooGoo: Frog
Posts: 37,385
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
Quote:
|
|
|
|
|
|
|
#12 |
|
.NUT
Join Date: May 05
Location: Sydney, Australia
Posts: 54,913
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
Don't explode just yet frog.
I'm not suggesting that using Runtime functions is a good idea. I'm just saying that you don't need to do anything special to avoid using them. There's no reason to use one inadvertently because it is patently obvious when you have. If you use the method name unqualified and it doesn't turn blue then it's a member of a module. If it's not a member of your own module then it must be a Runtime function.
__________________
![]() 2007, 2008, 2009, 2010 Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs MSDN "How Do I?" Videos: VB | C# VBForums Database Development FAQ My CodeBank Submissions: VB | C# (ForumAccount has translated some of my VB submissions to C#) My Blog: Defining and Raising Custom Events | Manipulating GDI+ Drawings | Using Parameters in ADO.NET |
|
|
|
|
|
#13 |
|
ASP.NET Moderator
Join Date: Feb 02
Location: Ulaan Baator GooGoo: Frog
Posts: 37,385
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
I was exploding about the VisualBasic namespace being implicitly referenced in VB.NET apps.
Does this apply to ASP.NET applications too? What would this say about the future of compatibility for ASP.NET v3.0 or v4.0 apps in the future when they remove it.
|
|
|
|
|
|
#14 |
|
.NUT
Join Date: May 05
Location: Sydney, Australia
Posts: 54,913
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
They certainly will not remove the Microsoft.VisualBasic namespace from the Framework. .NET 2.0 has added to it with the My objects. If they ever remove the modules that mimic the VB6 functions I'm sure they will deprecate them first, so you'll get at least one whole iteration of the Framework to eradicate them from your code. Given that each new version of ASP.NET will involve a new Framework, so older apps should still have their native version of the Framework installed, I don't see it being a problem.
__________________
![]() 2007, 2008, 2009, 2010 Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs MSDN "How Do I?" Videos: VB | C# VBForums Database Development FAQ My CodeBank Submissions: VB | C# (ForumAccount has translated some of my VB submissions to C#) My Blog: Defining and Raising Custom Events | Manipulating GDI+ Drawings | Using Parameters in ADO.NET |
|
|
|
|
|
#15 |
|
Frenzied Member
Join Date: Jul 02
Location: Dublin, Ireland
Posts: 1,721
![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
There is a bit of a potential misunderstanding arising from the fact that namespaces do not exactly map to dlls (in the .NET framework)
So the Microsoft.VisualBasic namespace is split across a number of assemblies/dlls including System.dll and MicrosoftVisualBasic.dll You can remove the reference to the dll MicrosoftVisualBasic.dll which will remove the VB6 compatibility commands like ChDir, MsgBox etc. You cannot remove all of the Microsoft.VisualBasic namespace because this includes essential elements such as the VB.Net compiler. |
|
|
|
|
|
#16 |
|
Dream Theater Fan
Join Date: Aug 02
Location: #!/bin/bash
Posts: 5,628
![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
The way I do it is to use C# instead
|
|
|
|
|
|
#17 | |
|
.NUT
Join Date: May 05
Location: Sydney, Australia
Posts: 54,913
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
Quote:
__________________
![]() 2007, 2008, 2009, 2010 Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs MSDN "How Do I?" Videos: VB | C# VBForums Database Development FAQ My CodeBank Submissions: VB | C# (ForumAccount has translated some of my VB submissions to C#) My Blog: Defining and Raising Custom Events | Manipulating GDI+ Drawings | Using Parameters in ADO.NET |
|
|
|
|
|
|
#18 | |
|
Dream Theater Fan
Join Date: Aug 02
Location: #!/bin/bash
Posts: 5,628
![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
Quote:
__________________
RPNSolve version 1.1.3 (Free commandline math parser) Go on, it's for charity.Registered Linux user number 0x7468A. My Flickr ![]() Of course you're free to go // Go and tell the world my story // Tell them about my brother // Tell them about me // The Count of Tuscany |
|
|
|
|
|
|
#19 | |
|
.NUT
Join Date: May 05
Location: Sydney, Australia
Posts: 54,913
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
Quote:
__________________
![]() 2007, 2008, 2009, 2010 Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs MSDN "How Do I?" Videos: VB | C# VBForums Database Development FAQ My CodeBank Submissions: VB | C# (ForumAccount has translated some of my VB submissions to C#) My Blog: Defining and Raising Custom Events | Manipulating GDI+ Drawings | Using Parameters in ADO.NET |
|
|
|
|
|
|
#20 | |
|
Hick
Join Date: Mar 05
Location: US of A
Posts: 2,280
![]() ![]() ![]() ![]() |
Re: Permanently turn off vb.namespace?
Quote:
C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\VBProjects |
|
|
|
|
|
|
#21 |
|
Admodistrator
Join Date: Jan 05
Posts: 3,900
![]() ![]() |
Re: Permanently turn off vb.namespace?
Try my way instead bill
|
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|