Yes, you can control this behavior using the Option directives at the beginning of each file or in the project settings:
Option Strict Off ' The following is dynamically typed: ' Dim x = "Hello"
Option Strict On Option Infer On ' This is statically typed: ' Dim x = "Hello"
It is best to set Option Strict On as the default value for all your projects (this can be done in the options dialog). This guarantees the same input behavior as in C #. Then, if you need dynamic typing, you can disable this option selectively based on each file using the directive above.
source share