Installed BlogEngine.NET Extensions pack now error

May 17, 2008 at 8:00 PM
I have posted this in the the BlogEngine.NET Extensions section as well but hope I can get an answer from someone as soon as possible. I may be reading the stack trace incorrectly but it looks like SnapShots.cs:23 is passing an invalid response to ExtensionSettings.cs:368 Now i got this error earlier where it was the   Odiogo.cs file instead of the SnapShots.cs: file I deleted the Odiogo.cs file thinking it was what was causing this but apparently not the case



Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

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: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Source Error:

Line 366:            {
Line 367:                if (par.Values != null)
Line 368: return par.Values[0];Line 369:            }
Line 370:        }

Source File: d:\redeyeproject.com\App_Code\ExtensionManager\ExtensionSettings.cs    Line: 368

Stack Trace:

[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.Collections.ArrayList.get_Item(Int32 index) +2880797
   System.Collections.Specialized.StringCollection.get_Item(Int32 index) +10
   ExtensionSettings.GetSingleValue(String parameterName) in d:\redeyeproject.com\App_Code\ExtensionManager\ExtensionSettings.cs:368
   SnapShots.get_Key() in d:\redeyeproject.com\App_Code\Extensions\SnapShots.cs:23
   SnapShots.AddSnapShotScript() in d:\redeyeproject.com\App_Code\Extensions\SnapShots.cs:63
   SnapShots.Page_Header(Object sender, EventArgs e) in d:\redeyeproject.com\App_Code\Extensions\SnapShots.cs:48
   System.EventHandler`1.Invoke(Object sender, TEventArgs e) +0
   BlogEngine.Core.Post.OnServing(Post post, ServingEventArgs arg) in C:\Documents and Settings\Mads Kristensen\Skrivebord\BlogEngine.Core\Post.cs:861
   BlogEngine.Core.Web.Controls.PostViewBase.get_Body() in C:\Documents and Settings\Mads Kristensen\Skrivebord\BlogEngine.Core\Web\Controls\PostViewBase.cs:175
   BlogEngine.Core.Web.Controls.PostViewBase.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\Mads Kristensen\Skrivebord\BlogEngine.Core\Web\Controls\PostViewBase.cs:40
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
Coordinator
May 18, 2008 at 12:23 AM
You need to change erroneous lines to :

if (par.Values != null && par.Values.Count > 0)
  return par.Values[0];

This was fixed a while ago, but 1.3 does not have this second check which sometimes may cause a problem.
May 18, 2008 at 11:28 PM
Thank you that worked perfectly