By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,670 Members | 1,462 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,670 IT Pros & Developers. It's quick & easy.

Option Strict Off/On

P: n/a
We have an application in our office that has the Option Strict option set to
off right now. I do understand it should be set to ON, but right now, I'm
just going to continue with it this way since I do not have the time to fix
everything to set it to ON.

Anyway, my question is if its set to OFF why is it it keeps getting set back
to ON, everytime we move the package from one machine to another. It's the
Option Strict option specific to the project?

So, how can I get the Option Strict option for this project to stay at OFF?

Thanks.
Jan 24 '08 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Greg wrote:
So, how can I get the Option Strict option for this project to stay
at OFF?
Just type Option Strict Off as the first line of every code file.

That way, it keeps silently nagging you to do something about the faulty
code. :-)

Andrew
Jan 24 '08 #2

P: n/a
Greg wrote:
We have an application in our office that has the Option Strict option set to
off right now.
.. . .
why is it it keeps getting set back to ON, everytime we move the package
from one machine to another. It's the Option Strict option specific to the
project?
There's another one!
There's a "default" for /all/ projects that's set at the IDE level. If
these are the way they're /supposed/ to be (i.e. On), you'll have to
switch it off again, every time.

Quick fix:
Stick the line

Option Strict Off

at the top of each source file. (It also acts as a visual reminder that
you've done this).

HTH,
Phill W.
Jan 24 '08 #3

P: n/a
Which kind of application ? It could be also part of the web.config file if
ASP.NET...

As others suggested my personal preference would be also to let this anyway
be On by default and to set this Off in each source file that really needs
this...

This way you are taking good habits for new code and you can fix the old
code on a file by file basis...

--
Patrice

"Greg" <Ac**********@newsgroups.nospama écrit dans le message de news:
29**********************************@microsoft.com...
We have an application in our office that has the Option Strict option set
to
off right now. I do understand it should be set to ON, but right now, I'm
just going to continue with it this way since I do not have the time to
fix
everything to set it to ON.

Anyway, my question is if its set to OFF why is it it keeps getting set
back
to ON, everytime we move the package from one machine to another. It's the
Option Strict option specific to the project?

So, how can I get the Option Strict option for this project to stay at
OFF?

Thanks.

Jan 24 '08 #4

P: n/a
OK, I've got it with regards to setting Option Strict in code for each file.
In fact, I just took the time today to make sure all the code is correct to
all Option Strict ON, which is best anyways.

But, what my question was though, if I set the Option Strict to OFF in the
Project's My Project tab/screen for a specific project, why would it keep
getting set back to ON, when it was changed for the project to be OFF? I
thought these were project specific settings.

I'm concerned that Visual Studio is changing settings I have already made
without notifying me. If I set Option Strict to OFF in my project, it seems
it should stay that way unless I change it. Or, is the Option Strict / Option
Compare and Option Explicit always changed back to default values regardless
of what I set them to?

This is what my question is, "Why does the Option Strict keep getting set to
ON, when I have specifically set it to OFF for my project?". I'm not having
problems with it now since I have fixed my code, I just want to know why it
keeps getting set back to ON everytime.

Thanks,
Greg

"Patrice" wrote:
Which kind of application ? It could be also part of the web.config file if
ASP.NET...

As others suggested my personal preference would be also to let this anyway
be On by default and to set this Off in each source file that really needs
this...

This way you are taking good habits for new code and you can fix the old
code on a file by file basis...

--
Patrice

"Greg" <Ac**********@newsgroups.nospama écrit dans le message de news:
29**********************************@microsoft.com...
We have an application in our office that has the Option Strict option set
to
off right now. I do understand it should be set to ON, but right now, I'm
just going to continue with it this way since I do not have the time to
fix
everything to set it to ON.

Anyway, my question is if its set to OFF why is it it keeps getting set
back
to ON, everytime we move the package from one machine to another. It's the
Option Strict option specific to the project?

So, how can I get the Option Strict option for this project to stay at
OFF?

Thanks.


Jan 24 '08 #5

P: n/a
Greg,

Your options are not project settings, it are your personal settings for
Visual Studio.

Cor

Jan 25 '08 #6

P: n/a
Michael,

You can better ask this to an MVP like Herfried, Bill or Seth (now) they
have contact with the product team, normally Linda does not.

:-)

(Yes I too and I have placed your question there)

:-)

Cor

Jan 25 '08 #7

P: n/a
Greg,

It takes some time and sometimes double casting, however I never had any
need to keep option strict off. (Maybe I come to it once, however sometimes
will casting over casting help a lot

a = DirectCast(A, DirectCast(b,c).d

Cor

Jan 26 '08 #8

P: n/a
Duh, wrong

x = DirectCast(DirecCast(A,B).C),E).F

Cor
Jan 26 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.