Server Error in '/' Application.

'minValue' cannot be greater than maxValue.
Parameter name: minValue

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: 'minValue' cannot be greater than maxValue.
Parameter name: minValue

Source Error:


Line 59:         CloudFotos cf = new CloudFotos(GlobalConst.CloudinaryCloudName, GlobalConst.CloudinaryApiKey, GlobalConst.CloudinaryApiSecret);
Line 60:         Random rnd = new Random();
Line 61:         int randomTrip1 = rnd.Next(0, trips.Count - 1);
Line 62:         int iCounter = 0;
Line 63:         foreach (Trip trip in trips.Values)

Source File: d:\www\www171\Newsletter.aspx.cs    Line: 61

Stack Trace:


[ArgumentOutOfRangeException: 'minValue' cannot be greater than maxValue.
Parameter name: minValue]
   System.Random.Next(Int32 minValue, Int32 maxValue) +12619960
   Newsletter.SetSiteContent() in d:\www\www171\Newsletter.aspx.cs:61
   Newsletter.Page_Load(Object sender, EventArgs e) in d:\www\www171\Newsletter.aspx.cs:29
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4682.0