Result of chr() cannot be used as initial value of a Const in .Net Core 3 Preview 1
See original GitHub issueVersion: 3.0.100-preview-009812 Commit: e3abf6e935
Runtime Environment: OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview-009812\
Host (useful for support): Version: 3.0.0-preview-27122-01 Commit: 00c5c8bc40
Have you experienced this same bug with .NET Framework?: No
In the .Net Framework using VB.Net you can compile this Line:
Private Const TabChar As Char = Chr(9)
In .Net Core 3 Preview 1 it failes with: error BC30059: Constant expression is required.
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (12 by maintainers)
Top Results From Across the Web
Why is Chr(3) a constant expression but not Chr(172)?
If I write the following code, ReSharper will suggest I convert the first variable, chr3 to a constant, but not the second variable,...
Read more >ASP.NET Core breaking changes for versions 3.0 and 3.1
Lists the breaking changes in ASP.NET Core 3.0 and 3.1.
Read more >SyntaxError: missing = in const declaration - JavaScript | MDN
An initializer for a constant is required; that is, you must specify its value in the same statement in which it's declared (which...
Read more >View | Android Developers
Quickly bring your app to life with less code, using a modern declarative approach to UI, and the simplicity of Kotlin. ... Start...
Read more >Backward Incompatible Changes - Manual
Any array that has a number n as its first numeric key will use n+1 for its next implicit key, even if n...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This works
It is basically doing what @AlekseyTs said: if there’s an microsoft.visualbasic.dll in the references, use that. I will base the real fix around this.
@DualBrain as a workaround, you can set the
VBRuntime
property todefault
in your vbproj file and the embedded VB runtime will not be used, allowing the referenced MS.VB.dll to be used instead.