Total .NET Analyzer Rule Documentation  

OptionStrictNotSet Rule

Set Option Strict for all projects.

Remarks

Although Visual Basic .NET allows you to perform implicit type conversions and late binding, you should avoid these practices. Implicit type conversions and late binding may lead to severe performance problems, runtime errors, and code that is difficult to read and maintain. For optimal performance, you should instruct Visual Basic to disallow implicit type conversions and late binding for all Visual Basic files.

Resolution

You should turn Option Strict on for all files in a project by following these steps:

1. With a project selected in Solution Explorer, choose View, Property Pages from the menu.
2. When the Property Page appears, highlight "Build" (under Common Properties on the left).
3. Under Compiler Defaults, set Option Strict to "On."

This sets the default to Option Strict On. Note that you can manually override this default for individual files by adding the "Option Strict Off" statement to individual files.

See Also

Option Strict Statement