I have encountered some strangeness in NETMF with VB. The following function definition throws an error “Constant expression is required” indicating the Microsoft.VisualBasic.Constants.vbcrlf is not a constant.
This same Microsoft.VisualBasic.Constants.vbcrlf can be used in other parts of the code as intended.
The same function definition in regular VB.NET works fine.
Function Something(Optional x As String = Microsoft.VisualBasic.Constants.vbCrLf) As String
Return x
End Function
The object Browser shows that Microsoft.visualbasic.constants.vbcrlf does exist as part of Microsoft.VisualBasic.
Assuming this is a problem in the NETMF 4.3, and not something I have overlooked, where should I post this as a bug?
@ Andre.m: Thanks for the answer. It is not that I need a workaround which I already have, but that this should be fixed. My question is if this is a NETMF implementation bug, what is the best way to bring it to the attention of those who might fix it?
It does look as a bug to me. As @ iamin pointed out in NETMF vbCrLf declared as a static not as a const value.
An optional parameter expects its default value be a const.