home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

VB.NET Option Explict/ Strict On to Defaut

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2147
Discussions: 200,972, Posts: 2,379,771, Members: 246,336
Old October 3rd, 2002, 09:00 PM   Digg it!   #1 (permalink)
Ordained Mommy
 
NeoStarO1's Avatar
 
Join Date: Oct 2001
Location: Big Sky Country
Posts: 4,259
Blog Entries: 1
VB.NET Option Explict/ Strict On to Defaut

Option Explict is set to On by default but how can I make the Option Strict to stay on as Default?

Right now I have to look at the properties of the windows application in the solution explorer and set option strict on each time a new project is opened.

TIA

NeoStar
NeoStarO1 is offline   Reply With Quote
Old October 3rd, 2002, 09:31 PM     #2 (permalink)
Not Really a Member
 
Join Date: Oct 2001
Posts: 25,398
you can just type it up at the top.. even if its turned on, I still check to make sure its there

option strict

I'll look around to see if I can find a default on place.
vass0922 is online now   Reply With Quote
Old October 3rd, 2002, 09:41 PM     #3 (permalink)
Not Really a Member
 
Join Date: Oct 2001
Posts: 25,398
Found an article about it, you can't do it from the GUI apparently

http://builder.com.com/article.jhtml...20522lan01.htm
__________________
Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.
vass0922 is online now   Reply With Quote
Old October 3rd, 2002, 09:42 PM     #4 (permalink)
Ordained Mommy
 
NeoStarO1's Avatar
 
Join Date: Oct 2001
Location: Big Sky Country
Posts: 4,259
Blog Entries: 1
Yes you can type it in you are correct, however each script you do you will need to remeber to type that in EVERY single time. Meaning if you have more than one form you'll need to remember to type it in each time for option strict. Option Expict is set by default but Ooption strict is not.

there are a quite a few bugs in VB.NET. will post them as I come along as I know I will hit them.

Im just hoping that its in there some place to make option strict set On as default.

Edit: ok im reading, i'll post my thoughts back. gotta pick up kids. yowzeeeeee im late. Varoooooooooooommmmmmmmmmmmmm
NeoStarO1 is offline   Reply With Quote
Old October 3rd, 2002, 10:07 PM     #5 (permalink)
Ordained Mommy
 
NeoStarO1's Avatar
 
Join Date: Oct 2001
Location: Big Sky Country
Posts: 4,259
Blog Entries: 1
Okay Im reading and here it says............
Quote:
To configure each template to default Option Strict to On rather than Off, load each .vbproj template with VB source code into an editor like Notepad and then change the XML that defines the template.

He doesn't really give a definate how to fix all this, sounds like a major time consuming process nor does he state exactly where option strict needs to be set to make the changes.

Article kind of leaves you hanging dry.

Note he sayd Each, I'll bold it this is why i think its a major time consuming process cuz he doesn't state how many needs to be done. as if there is more than one place to fix it.
NeoStarO1 is offline   Reply With Quote
Old October 3rd, 2002, 10:20 PM     #6 (permalink)
Not Really a Member
 
Join Date: Oct 2001
Posts: 25,398
well what he means is each template .vbproj
You'll probably only be doing windows projects so you'll only need to do that one (windows app template).
If you start on a webapp or a activex project then you'll have to worry about those.
vass0922 is online now   Reply With Quote
Old October 3rd, 2002, 10:30 PM     #7 (permalink)
Ordained Mommy
 
NeoStarO1's Avatar
 
Join Date: Oct 2001
Location: Big Sky Country
Posts: 4,259
Blog Entries: 1
no i figured it out.

Im tickled pink, he explains it alright but he did a horrible time wording that article.

AFAIK all you have to do is modify the file called "Windows Application\Templates\1033\WindowsApplication.vbpr oj" and under the line that says....

[code]
<VisualStudioProject>
<VisualBasic>
<Build>
<Settings OutputType = “WinExe”>
<Config . . . .
[code]

Now in between up there just after the "WinExe" type in same formate each line this....

Code:
OptionStrict = “On”
OptionExplicit = “On”
He does state that other templetes may need to be modified but as far as I know this sets that defualt setting to both "On' under the WindowsApplication Prooperties under the build tab for both of them set to "on" as default.

I even shut down to make sue this setting was gonna stick, now if this changes as I go along adding new forms, and all the other good stuff i'll post back to what other ones need to be modified as well.

everyone in class is griping about this so gonna post this to the listserve as well but wording in my own freaking words where its understandable and not the garbage that writter did.

So far I have no ill effects on my templates.

Edit:

Quote:
If you start on a webapp or a activex project then you'll have to worry about those.

So where are these ones located? I might as well do the hole shebang while im at it. how many can there be?


Edit2: Okay so if that is it then there are only three files that need to be modified. and those would be these three.

Code:
X:\Program Files\Microsoft Visual Studio .NET\Vb7\VBWizards\WindowsApplication\Templates\1033


X:\Program Files\Microsoft Visual Studio .NET\Vb7\VBWizards\WebServiceApplication\Templates\1033

X:\Program Files\Microsoft Visual Studio .NET\Vb7\VBWizards\WebApplication\Templates\1033
so what else am I not getting that needs to be modified to set this throughout the entire program?

Edit3: okay so its more like a total of 38 files that need this set for it to be through out the entire program, now i see why he said that Each need to be modified, So each needs to be modified that are in teh VBWizard/Templates/1033. So each 38 sections of the vbwizards has a 1033 folder just after templates and all have this "application" like thing in the folder so each of them need to be modified.

Well I would think better take time out for 1/2 to add those two lines of codes to save headaches later of forgetting to set option strict on as default.

Edit 4: After more research in the files turns out there are only a total of four files that need to be modified, those are WindowsApplication, WebServiceApplication, WebApplication, ConsoleApplication.

Last edited by NeoStarO1 : October 6th, 2002 at 08:41 PM.
NeoStarO1 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Charges against non-tippers dropped.. (6)
Is It Just Me? (3055)
The disrespect of Obama by Russian .. (48)
Delete an OS (16)
Nvidia GTX 260 problem (8)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
windows vista security holes (17)
Regular Build (11)
windows 7 problem (7)
Internet Lost (5)
Point and Shoot Camera Suggestions. (6)
Print spooler problem (16)
Recent Discussions
Delete an OS (16)
Multiple Restarts Required at Boot (4)
cell phone won't work (0)
Nvidia GTX 260 problem (8)
Is the PSU I received dead? (15)
Can't open Word (12)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (37)
Steam ID's, Gamertags etc... (4)
Games, Cables, PCI cards, and more fo.. (6)
Dept. of HS: NSA 'Helped' Develop Vis.. (17)
Linksys WMP54GS wireless card problem.. (5)
windows vista security holes (17)
Help getting around port 80 for camer.. (5)
Skillsoft Network+ Study Software Que.. (10)
Browsers wont load websites (3)
help me pls laptop just stopped worki.. (0)
Open With ..... Win7 (3)
Laptop with wireless problem. (12)
Internet Lost (5)
virus blocking exe. files (1)
Point and Shoot Camera Suggestions. (6)
CPU fan stops spinning randomly (11)
Modern Warfare 2: Who Bought It? (65)
Print spooler problem (16)
Kingston Bluetooth Dongle Driver (1)


All times are GMT -4. The time now is 10:33 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28