Visual Basic .NET Language Option Strict How to Switch It On

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

  • You can switch it On at the Module/Class Level by placing the directive at the top of the code file.

    Option Strict On  
    
  • You can switch it on at the project level via the menu in Visual Studio

Project > [Project] Properties > Compile Tab > Option Strict > On

Project Properties > Compile Tab, the highlighted word is the option strict that you want to change.

  • You can switch it On by default for all new Projects by selecting:

Tools > Options > Projects and Solutions > VB defaults > Option Strict
Set it to On.



Got any Visual Basic .NET Language Question?