Option Compare Text
Module Module1
Sub Main()
#If MyString = "ABC" Then
MsgBox("You have been compiled!")
#End If
End Sub
End Module
----------------------
Create a new project , console app is ideal, and paste in the above code.
Create a conditional compilation(configuration properties->Build) variable...MyString="ABC"
The #if may or may not compile. On my machine as displayed above it compiles. But if I comment out the Option Compare line, then it will not compile.
According to the docs #if is not subject to Option Compare, specifically, it says all #if's assume Option Compare Text!
This is a PITA.
OK now for some really big craziness. Ensure the Option Compare is not commented out....
Use: CommonProperties->Build->Option Compare to change the value to Text, apply it try build, then change it to Binary, build and see what happens. The value here seems to interfere with the option compare specified at the top of the source!
If you can reproduce this problem then please respond. If not, then please don't worry. I am not mental and I can do that consistently just with a simple project and the source code above.
Regards,
--------------------------------
From: Chris Nurse
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>8E0kFTBMtUyIrau+V7WQRQ==</Id>