Server Error in '/' Application.

Index was outside the bounds of the array.

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.IndexOutOfRangeException: Index was outside the bounds of the array.

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:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +14338206
   System.Data.Entity.Core.Objects.ObjectStateManager.AddEntityEntryToDictionary(EntityEntry entry, EntityState state) +343
   System.Data.Entity.Core.Objects.ObjectStateManager.AddEntry(IEntityWrapper wrappedObject, EntityKey passedKey, EntitySet entitySet, String argumentName, Boolean isAdded) +859
   System.Data.Entity.Core.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly(Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet) +362
   lambda_method(Closure , Shaper ) +425
   System.Data.Entity.Core.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper) +384
   System.Data.Entity.Core.Common.Internal.Materialization.SimpleEnumerator.MoveNext() +88
   System.Linq.Enumerable.First(IEnumerable`1 source) +248
   BL.Blm.GetLastLocationOne() in C:\Users\PC\Source\Repos\AsanBTC2\BL\Blm.cs:717
   AsanBTC.Contents.NewsSection() in C:\Users\PC\Source\Repos\AsanBTC2\AsanBTC\Contents.aspx.cs:944
   AsanBTC.Contents.Page_Load(Object sender, EventArgs e) in C:\Users\PC\Source\Repos\AsanBTC2\AsanBTC\Contents.aspx.cs:36
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4082


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