Last post Dec 13, 2017 09:04 AM by Deepak Panchal
Dec 12, 2017 02:46 PM|Corobori|LINK
Since last week's update of my Visual Studio all my projects are coming up with errors such as "Option Strict On requires that all method parameters have an 'As' clause" despite the project having the
Option Strict "Off". It's happening on all my projects now. The only way around I found is to go in Compile change the "Option Strict" to On, save the project, and change the "Option Strict" to Off and save the project. This appears to solve
But anyway I am wondering if I should always be working with the "Option Strict" to On. What are your thoughts ?
Dec 12, 2017 03:00 PM|PatriceSc|LINK
Yes, it's likely best to be strict. For example here it seems you are working often with the "object" type when a more accurate type could perhaps be used. See
https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/option-strict-statement for a reference.
You can enable/disable this on a file by file basis (by adding the statement at the top) which could allow to move progressively from Option Strict Off to Option Strict On and maybe keep that if really needed ("late binding" which is unlikely needed in most
Dec 13, 2017 06:46 AM|zxj|LINK
When you use the Option Strict statement, the statement must appear before any other code. In Visual Basic .NET, you can typically convert any data type to any other data type implicitly. Data loss can occur when the value of one data type is converted to
a data type with less precision or with a smaller capacity. However, you receive a run-time error message if data will be lost in such a conversion. Option Strict notifies you of these types of conversions at compile time so that you can avoid them.
Dec 13, 2017 09:04 AM|Deepak Panchal|LINK
its looks like new update have some changes caused this issue.
so you need to modify in your project to meet with new update configuration.
for a detailed information regarding Option Strict. you can refer link below.
Option Strict Statement