I use the Random() function in order to get random double values. It works fine when launched manually (each time new random values are well generated), but the values are the same each time when it is launched by the Windows Task Scheduler.
Would you know why and how to resolve this issue ? Thanks
var random = new Random(DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Hour);
double randomStat = new double();
randomStat = Math.Round(GetRandomDouble(random, 5, 250), 1);
static double GetRandomDouble(Random random, double min, double max)
{
return min + (random.NextDouble() * (max - min));
}