Closed eternaldensity closed 5 years ago
Now that I think about it... I should check Mono since that's what Blazor actually uses.
Okay, SystemRandom.NextDouble seems to exist in Mono too so I'm not sure why it won't work here.
This looks like a linkage issue: assemblies are stripped of unused code during compilation, unless they're listed here. We should keep the whole mscorlib, not just some specific type in it.
Yep, after applying this fix, NextDouble
is now working. Thanks for the report!
Ah, that makes sense. Cool, thanks, and glad to help.
I figured it would be fun and interesting to try running the F# tutorial code that comes as a new project type with Visual Studio, in the 'try F# in your browser' example at https://tryfsharp.fsbolero.io/
There's a few compile errors. I chopped out just the failing bits for brevity.
Code:
Compile Errors from https://tryfsharp.fsbolero.io/ :
The latter three errors look like a difference in how globalization is handled for datetimes between this version of .NET and what VS is using. (VS Community 2019 16.25.3 if that helps.) Probably not a big deal.
But .NextDouble() being missing from System.Random is rather odd. .Next() is there but of course it produces an int not a float.
I'm pretty sure the presence of System.Random.NextDouble() is something that should be available consistently.