I am trying out the Visual Studio 2015 RC project template for creating a class library
that can target any platform
says Visual Studio.
A new project has 2 references: DNX 4.5.1 and DNX Core 5.0. It appears that System.Random
is not available in DNX Core 5.0. (The same is true for the .NET Core 5.0 Console project template.)
For .NET Core libraries/apps, what options are there for generating random numbers?
To truly target any platform, I guess one could implement a pseudorandom number generator, or wait until a DNX Core-compatible reference is available, that has someone else implement a PRNG. Microsoft could be that someone by the time 2015 is no longer "RC".
I think it's included in System.Runtime.Extensions package. Add it to dependencies and run
dnu restore
if you are building from the command line. Then it should build.