TechnoTone Posted February 20, 2003 Posted February 20, 2003 I've searched these forums and found lots of references to Option Strict, most of which say that you should turn this on for all projects. However, I can't find any way to turn this on by default. Is it possible and if so, how? wyrd mentioned writing an add-in that automatically sets Option Strict to On and removes the Microsoft.VisualBasic import. I can't find any reference in the online help regarding add-ins - how would you go about doing this? Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
*Gurus* divil Posted February 20, 2003 *Gurus* Posted February 20, 2003 The only thing I can think of is finding the new project templates (they're there somewhere) and modifying them. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
TechnoTone Posted February 20, 2003 Author Posted February 20, 2003 I've already checked them (that's where I removed the references to the Microsoft.VisualBasic namespace) but Option Strict/Explicit isn't there. I have been wondering whether you could do something with the scripts in the VBWizards folder but it's a little daunting to me. What about the Add-in idea? Any sources of information on writing add-ins? Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
*Gurus* divil Posted February 20, 2003 *Gurus* Posted February 20, 2003 I had a quick go, and I was able to do this. I opened the file: \VS.NET\Vb7\VBWizards\WindowsApplication\Templates\1033\WindowsApplication.vbproj And added the line: OptionStrict = "On" Just after the OutputType = "WinExe" line. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
TechnoTone Posted February 20, 2003 Author Posted February 20, 2003 Nice one. Not seeing Option Explicit there I figured it wasn't the correct place. I guess Option Explicit = "On" is a default anyway. Thanks. Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
*Experts* Volte Posted February 20, 2003 *Experts* Posted February 20, 2003 On a side note, removing the reference to Microsoft.VisualBasic is useless; it is required regardless, and will be referenced anyway. Besides, they're not all bad anyway. Quote
TechnoTone Posted February 21, 2003 Author Posted February 21, 2003 On a side note, removing the reference to Microsoft.VisualBasic is useless; it is required regardless, and will be referenced anyway. Besides, they're not all bad anyway. Are you sure about that? It works on mine! Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
*Gurus* Derek Stone Posted February 21, 2003 *Gurus* Posted February 21, 2003 You can remove the imports statement but you cannot remove the reference. The Visual Basic .NET compiler (vbc.exe) will add the reference regardless, whether a project is compiled from Visual Studio or from the command line. This shouldn't be a concern to anyone however, since the Microsoft.VisualBasic assembly is distributed as an integral part of the .NET Framework. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.