x First time here? Check out the FAQ
  • Avatar4329posts9835karma2015 MVP

    The given key was not present in the dictionary after creating blogpost

    Jeroen Breuer started this topic September 1, 2010 @ 11:04, Go directly to the topic solution


    I upgraded from Umbraco 4.5.1 to 4.5.2 and now I get the following exception when I try to create a new blogpost in Blog 4 Umbraco:

    The given key was not present in the dictionary. 
    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.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

    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: 
    [KeyNotFoundException: The given key was not present in the dictionary.]
    System.Collections.Generic.Dictionary`2.get_Item(TKey key) +9489373
    umbraco.library.niceUrlDo(Int32 nodeID, Int32 startNodeDepth) +277
    umbraco.library.NiceUrlFullPath(Int32 nodeID) +41
    Umlaut.Umb.Blog.EventHandlers.Autoping.Document_AfterPublish(Document sender, PublishEventArgs e) in d:\TeamCity\buildAgent\work\6c8a1edaa924eb51\Umlaut.Umb.Blog\EventHandlers\Autoping.cs:43
    umbraco.cms.businesslogic.web.Document.FireAfterPublish(PublishEventArgs e) +75
    umbraco.cms.businesslogic.web.Document.PublishWithResult(User u) +2528
    umbraco.cms.presentation.editContent.Publish(Object sender, EventArgs e) +308
    System.EventHandler.Invoke(Object sender, EventArgs e) +0
    umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e) +96
    System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
    System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120
    System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

    Could this have happend from upgrading?

    I've already added a codeplex item for this: http://blog4umbraco.codeplex.com/workitem/5526.


  • Avatar26posts59karma
    Comment with ID: 46058
    Frej Raahede Nielsen posted this reply September 6, 2010 @ 09:12

    I get a similar error with Umbraco 4.5.2. "By accident" I installed Blog4Umbraco via the package repository in Umbraco, which I uninstalled and then installed the 4.5 version.

  • Duncan Gunn posted this reply September 7, 2010 @ 05:08

    This doesn't happen straight away on creating the blog post for me, but I do get the same error when I enter some content and publish.

    However it sorts itself out and seems to work when I refresh the nodes.

    Another thing that could be related is that the blog post initially is created directly under the Blog node, not under the 2010/9/7 structure.

    Publishing, ignoring the error and refreshing fixes this.

  • Avatar229posts416karma
    Comment with ID: 46167
    Shaun posted this reply September 7, 2010 @ 07:21

    I'm seeing the same behavior as Duncan. I have googled and according to this chap...http://twitter.com/theplastictoy, blog4umbraco can be made to work "smoothly" by using this changeset - http://blog4umbraco.codeplex.com/SourceControl/changeset/changes/54177

    Unfortunately I have no idea what to do with the changeset now I've downloaded it. Anyone else got any ideas?



  • Avatar26posts59karma
    Comment with ID: 46650
    Frej Raahede Nielsen posted this reply September 13, 2010 @ 05:54

    I get a rather strange error that might have something to do with the .NET error on publish: The blog creates a dublicate of the datefolders and blog post - with the same id! 

    I will try updating the package and see if it fixes it.

  • Rick Ratayczak posted this reply September 15, 2010 @ 08:55

    I am getting this error, and I also don't know what to do with the changeset either.

    When I try to set the blog skin I also get this error:

    Error installing skin:
    System.IO.FileLoadException: Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=, 
    Culture=neutral, PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. The located assembly's 
    manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File 
    name: 'ICSharpCode.SharpZipLib, Version=, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' 
    at Umlaut.Umb.Blog.DataTypes.SkinBrowser.ExtractPackage(String zipPath) at Umlaut.Umb.Blog.DataTypes.
    SkinBrowserDatatype.DataEditorControl_OnSave(EventArgs e) in d:\TeamCity\buildAgent\work\
    6c8a1edaa924eb51\Umlaut.Umb.Blog\DataTypes\SkinBrowserDatatype.cs:line 71 WRN: Assembly binding
    logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

  • Avatar1024posts2649karma
    Comment with ID: 47890
    Lee posted this reply September 23, 2010 @ 09:02

    I am having this problem, however I think its an actual problem with an event that triggers after the post is published I'm going to download the code from codeplex and see if I can figure it.

    @Shaun - That changeset will not fix this bug, if you look at the comments its from Ben (CodeGecko) and all he has done is changed the XSLT files not the core. If I make any progress I'll post back here


  • Duncan Gunn posted this reply September 23, 2010 @ 10:55

    Thanks Lee, look forward to seeing how you get on.

  • Avatar1024posts2649karma
    Comment with ID: 47910
    Lee posted this reply September 24, 2010 @ 07:48

    I have narrowed down the problem, and it is a problem with blog4umbraco package - If you install and leave the root blog node in its default location it works fine 


    But as soon as you move the blog under a different node, this is what I have done

    -- Blog
    -- Other Page

    when you try and PUBLISH the node it fails and cannot generate the URL - I have some client work to get completed this morning, but will download and try to submit a patch on Codeplex this afternoon.

  • Avatar1024posts2649karma
    Comment with ID: 47911
    Lee posted this reply September 24, 2010 @ 08:00

    In fact even moving it back to its original position still keeps the bug!  Annoying...

  • Avatar1024posts2649karma
    Comment with ID: 47930
    Lee posted this reply September 24, 2010 @ 11:02

    Ok I think have found the problem and fixed the 'The given key was not present in the dictionary' message appearing, its to do with the Autoping class and it not getting the fullpathURL to the blog.

    I'm going to need to check with Tim as it just doesn't seem to be able to get the Nice URL of the node from the NodeID even though the event is triggered after publish? Even though my fix stops the error, it still means the autoping won't work and will ping with an invalid URL.

    I'll spend another half an hour playing, and if I'm still stumped I'll email Tim :)  I'll post up the DLL's in a bit for you to use, to stop this message


Please login or Sign up To post replies