Server Error in '/' Application.

StartIndex cannot be less than zero.
Parameter name: startIndex

Description: An unhandled exception occurred.

Exception Details: System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex]
   System.String.Remove(Int32 startIndex, Int32 count) +7099799
   ParksCanada.Website.MVC.Services.PageComponentService.ReplaceFirstOccurrence(String source, String find, String replace) +134
   ParksCanada.Website.MVC.Services.PageComponentService.GetThisWeekItem(String thisWeekPath, String& thisweekPagePath) +930
   ParksCanada.Website.MVC.Services.PageComponentService.GetThisWeekDetails(String thisWeekPath) +80
   ParksCanada.Website.MVC.Controllers.PageComponentController.GetThisWeekDetails() +382
   lambda_method(Closure , ControllerBase , Object[] ) +87
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
   System.Web.Mvc.<>c__DisplayClass24_0.<InvokeActionMethodWithFilters>b__0() +80
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +466
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +466
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +524


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