[MonoDevelop] VB.Net Option Strict

Michael Hutchinson m.j.hutchinson at gmail.com
Sat Sep 22 06:15:35 EDT 2007


On 9/22/07, Markus Kilås <digital at markuspage.com> wrote:
> Hi all!
>
> I am trying to port an VB.net application to Mono but are getting some
> trouble compiling with Monodevelop.
>
> I have created a VB.net-project and added all the .vb-files but when a
> try to compile I get an error for each file:
>
> [Task:File=, Line=0, Column=0, Type=Error, Priority=Normal,
> Description=Option Strict Off will probably
> fail.((/home/markus/Projects/dotnetproject/dotnetproject/file.vb))]
>
> What is "Option Strict", where can I find info about it and how can a
> change it?

Disclaimer: I haven't used VB since the pre-.NET days, but I'm pretty
sure this option isn't new.

However, the top Google search result is
http://msdn2.microsoft.com/en-us/library/zcd4xwzs(VS.80).aspx which
explains its meaning pretty well. Basically, it helps you avoid bad
casts. No idea why it isn't on by default.

So, you can either
1. Add "Option Strict On" at the top of every VB.NET file.
or
2. Pass /optionstrict+ to the VB.NET compiler. I'm not sure if this is
possible in MD in the project configuration options; if it isn't,
please open a bug report / feature request.

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Monodevelop-list mailing list