Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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) +9489373umbraco.library.niceUrlDo(Int32 nodeID, Int32 startNodeDepth) +277umbraco.library.NiceUrlFullPath(Int32 nodeID) +41Umlaut.Umb.Blog.EventHandlers.Autoping.Document_AfterPublish(Document sender, PublishEventArgs e) in d:\TeamCity\buildAgent\work\6c8a1edaa924eb51\Umlaut.Umb.Blog\EventHandlers\Autoping.cs:43umbraco.cms.businesslogic.web.Document.FireAfterPublish(PublishEventArgs e) +75umbraco.cms.businesslogic.web.Document.PublishWithResult(User u) +2528umbraco.cms.presentation.editContent.Publish(Object sender, EventArgs e) +308System.EventHandler.Invoke(Object sender, EventArgs e) +0umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e) +96System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563Could this have happend from upgrading?
I've already added a codeplex item for this: http://blog4umbraco.codeplex.com/workitem/5526.
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.
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.
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?
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.
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=0.85.4.369,
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=0.85.4.369, 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].
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
Thanks Lee, look forward to seeing how you get on.
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
Home-- 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.
In fact even moving it back to its original position still keeps the bug! Annoying...
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
I have found a workaround but it's a small hack though.
If you remove the "Ping" property from the Blog document type, now it doesnt throw an error. But you still cant use the dashboard for creating posts.
Just wondering if you made any progress on this? If not I'll take a bash at it over the weekend...
I have sorted the problem in the blog4umbraco package, but its not different really to removing the ping property above as at the moment you can't use the ping property because there is actually what seems to be an underlying bug in the umbraco core.
I started to try and debug the core, well NiceURL() to be precise but I struggled to get the solution to compile in .NET 4 as that's what my site is running - this is as far as I got
As you can see there is a bug in the after publish event which stops umbraco being able to get the URL of the currently published node.
I have found a workaround, please let me know if it works for you.
Thats not a work around, if you create another new post you will still get the error... It only trys to ping (I think) on the first publish so you can re-publish after without the error..
The work around is as posted by Bo above, which is basically remove the 'ping' feature
NiceUrl uses the xml cache and a new node won't be in there the first time afterPublish fires. Normally I'd check sender.Published before using it, but in this case that would mean you'd always have to publish twice the first time to get pinging to work. I wonder if there's an easy way to pull the Url from the database instead?
Sounds like the cache just needs to be updated first according to this - http://our.umbraco.org/forum/developers/api-questions/3135-Afterpublish-get-document-url? Kind of wasteful to do it every time though.
That does the trick. I added this line
before the call the NiceUrlFullPath and it publishes ok. Not really that wasteful since it only updates the node being published.
Top man! Completely and utterly missed that! Have you submitted it to codeplex for Tim to add to the project?
I applied this fix and it works now to publish new blog posts, thank you Jeff :) ... unfortunately, the post is now always placed directly under the blog root instead of the date folder hierarchy (2010/10/08).
All I did was adding the UpdateDocumentCache-line in the b4u code and recompiled, then replaced the Umlaut.Umb.Blog.dll on the server with the new one.
Hmmm ... any additional ideas?
Looks like that runs in BeforePublish, so shouldn't be affected by the change you made. See EventHandlers/BlogDateFolder.cs You should also have some entries in umbracoLog telling you what happened with the date folder.
I was working with 54177. Looks like there was no EventHandlers\BlogDateFolder.cs in the release you're using? Not sure how the date folder was being created in that case.
I wanted to use the last stable release as the codebase for the fix ... but now I tried with 54177 too and same thing ... post gets created directly under the root. If I roll back to the old assembly, it works fine again (of course, with the new bug that I can't publish then).
That's frustrating. :(
Can you upload your assembly somewhere so I can try this one? Maybe I'm just doing something wrong. Would really appreciate that :)
Can you debug and see if the handler in BlogDateFolder.cs is getting hit when you publish the post? If you're not seeing anything in the log, sounds like the handler is not being called, but I've no idea what would cause that.
I think I found the problem. I freshly installed a 4.5.2 Umbraco instance on my dev machine and installed the blog package. The behaviour of the blog package is different than on my production machine. In Prod, a new post gets directly created under the date folders (which are created, if needed). On my local dev machine, the blog post gets firstly created on top level and is then moved to the date folder on publish/save.
The behaviour on the dev machine fits to the code, and there I found a property on the BlogPost doctype which is called "PostDate" ... in the code, this property is checked and if it does not exist, the date folder creation is skipped.
In prod, the Document Type does not have this property.
So, it seems I have a old Blog4Umbraco version in prod ... but the package manager says Blog4Umbraco 2.0.26 ... as does my new and freshly installed local dev instance.
Does this package gets updated with new code while the version number is not raised?
Next intresting thing is ... the thread-starting issue ("the given key was not present ...") also just does not appear ... i can use Blog4Umbraco without any errors in 4.5.2 ...
Consider me confused :)
Anyhow, I'll try to upgrade my blog package in prod now ...
Is it safe to use the latest changeset of Blog4Umbraco? Does this error still occur and is this workitem already fixed?
No I dont think it is.
I've spent the day doing the following:
1. Upgrade of Umbraco from 4 - 4.5 (latest release)2. Upgraded Blog4Umbraco to Blog4Umbraco_2.0.26_for_4.5.zip3. Error when publishing still exists
1. Fresh vanilla install of 4.52. Fresh vanilla install of Blog4Umbraco3. Got a cannot load control error and some xslt errors
I'm in a right mess now!
I think Blog4Umbraco is a fantastic offering given that it is free but it'd be great to a solid blog componant for Umbraco that worked out of the box.Could we not have a "donation" drive to fund this. I for one wouldn't mind paying towards getting a solid blog platform for Umbraco up and running I'd also be happy to contribute time-wise.
Did you try all of this with the latest changeset from codeplex or the download on the project page?
Missed out another step above - when trying the vanilla installs I did it with both versions.
Comments also seem to be nacked as well.
If you are using .NET 4 I have a working blog4umbraco DLL which has been updated and can post a link to if anyone needs it?
Hi Lee - most helpful, I'll take one off your hands please. :)
That would be great! I'm using Umbraco 4.5.2 with .NET 4 so I would love to have a working DLL. Is that the only updated file so does it work with all the XSLT files from the latest changeset?
Correction. I have just done another vanilla install of :
1. Umbraco_4_5_2_for_NET_4.zip2. Blog4Umbraco_2.0.26_for_4.5.zip
This works ok - although comments can still not be posted.
I think my original Umbraco upgrade hasnt worked. I should be getting lots of xslt errors surely? I cant find a way of forcing the upgrade to use the latest schema.
Give this a try
@lee Thanks will give it a try.
@Greyhoud If you download the latest changeset (http://blog4umbraco.codeplex.com/SourceControl/changeset/changes/54177) the XSLT files in this download should work (not tested yet).
@Lee - thanks. This dll doesnt create date folders - is this the intended behaviour?
@Jeroen - thanks, I'll give them a try,
@Greyhound - It's working fine for me, firstly make sure you definitely have the 'postDate' propety on your blogpost doctype (See below) as this is what is used for the Date Folder in the latest one ALSO without trying to sound funny you do know it only creates the DateFolder AFTER you have published the post for the first time.
So if you create a new blog post, it won't show in a date folder straight away - It will just show under the blog node as unpublished, once you 'Save & Publish' it will then create the date folder and move the post.
Thanks Lee - I added the postDate property and this has sorted it out. I've got bigger problems though which is making B4U a show stopper.
Something is defintely not happy since my upgrade to 4.5.2 which I am now cursing ever having attempted.
I'm getting errors like "Error parsing XSLT file: \xslt\Blogpages.xslt" now and am unable to save any of the XSLT files in the admin (invalid data at the root level etc)
Giving it another 2 hours then giving in, I was in love with Umbraco until it came to upgrading and this blog business!!
You might check in a text editor if there is an extra character at the end of the xslt file when you get the root level error. That was the problem with BlogTagCloud in the version I downloaded.
Thank you, that got it - now I'm searching for an answer to :
"Value was either too large or too small for an Int32" - its defintely one of those days.
That's usually a call to niceUrl or GetMedia that has a bad value being passed in, but I have seen that in 4.5.2 when saving xslt in the admin when the xslt is actually fine. If you check the box to ignore errors, does the xslt actually work on your site?
Weirdly enough that looks to be the case although ignoring the errors still doesnt render the XSLT.
In BlogTagCloud I changed:
This works ok but I'm not sure where to start looking now in order to fix the ID problem. I'm assuming that due to the site upgrade there is an old value somewhere that is still be used?
Your help is very much appreciated.
If it's just the xpath not working, then first spot to check is umbraco.config. If it's not obvious there, then you might have to hit the debugger.
I've replaced the the entire contents of the config folder with the vanilla install (which is working) but to no avail. Something has obviously gone very wrong with the initial upgrade although everything is fine apart from the blog.
12 hours straight and feeling very dispondent - throwing the towel in. It just shouldnt be this hard to upgrade a CMS and blog.
Thanks for your help anyway.
After a reboot and a nice cup of coffee everything is playing nicely. I can only assume that this would due to some cacheing problem.
The modified DLL is working so thanks Jeff and Lee.
@Jeff - as you have probably guessed I'm more of a creative than a developer but if I can ever help you out with some graphics or css in return for the dll then do let me know.
"Give this a try
Hi Lee, my computer has .Net 2.0, 3.5 and 4.0 framework, and I installed Umbraco 4.52 by web installer. When I replaced the b4u DLL, I got the following errors. Do you know the reasons? thanks.
May be worth checking in IIS that the website is running in framework version 4.
I think that error message means that the website is running in a version lower than 4 and the dll requires framework 4.
8: <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=22.214.171.124, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
9: <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=126.96.36.199, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
10: <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=188.8.131.52, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler'
You can't just change the site to run on v4 without changing all the other files to reflect this - Obviously one of them will be the web.config.
You are currently running the site as v3.5, so if you want to change to v4 you need to update ALL the other DLL's from the ASP.NET v4 version of umbraco from CodePlex and then update the web.config to reflect this too.
Thanks for your reply! I might need to re-install the umbraco. The current problem is that I have already built part of the website. Do you have any suggestion how to export it before uninstall the umbraco, and how to import it back after re-installation ? Thanks.
Yep you can create a package from your site and install the package into your new install - I suggest you get a subscription to umbraco.tv as I think that has some videos on creating a package. Its very simple to do - You might be able to find out more from just googling around or searching the forums.
I have subscribed to umbraco.tv. I will check it out.
Good stuff - Hope the HQ reads this and I get some extra karma for selling umbraco.tv subscriptions :P ..lol
Yeah, you deserve some extra karma. :)
I just checked the videos and didn't find the topic about creating a package. Could you give me a link?
The link to that updated DLL seems to no longer work. I am having this problem; does anyone know where I can get that updated DLL?
I deleted it from the server - I'll re-upload in a minute
Its back... I'll leave it there for a few days
*Cough* feel free to apply some high fives if this helps anyone ;) Nothing like a bit of karma to show your appreciation :P
Thanks Lee, much appreciated. I'd high five ya if I had enough karma to do so.
Just curious if there's a .NET 2.0 version that anyone has compiled from the source?
“*Cough* feel free to apply some high fives if this helps anyone ;) Nothing like a bit of karma to show your appreciation :P”
I tried to vote but was rejected because I don't have 70 Karmas. I will come back to vote when I collect enough Karmas.:)
I didn't have enough time to get compile the project in 2.0 but I have updated the zip to contain both 4.0 and 3.5 versions now
What exactly is different from this dll compared to the latest changeset (54177) on codeplex?
I just tested you dll Lee and the bug I started this topic for is now solved! Guess that's what your dll does :). Thanks.
Great stuff - Don't forget to mark the thread as solved to help other people looking for the same issue.
Which post should I mark as the answer? The one where people can download your dll seems the best post, but if you remove the dll I should mark another post as the answer.
Yeah mark that one, I'll leave them up until the source is changed on Codeplex
Publishing now works, but is really slow. Is this because of your dll and is it related to ping? I've added 4 external links to ping.
The .Net 3.5 DLL works for me. Many thanks!
@Jeroen - Yep pinging multiple sites can be slow, I stupidly added 20 odd sites when I first started using it and it constantly timed out. Try using ping-o-matic or similar that does the multiple pinging for you (rpc.pingomatic.com)
the dll is working great, I had the same problem as the OP. I have also created the postDate property in the blogpost content type but when I "save and publish" the blog post it remains at the root of the blog, any thoughts?
Another thing I just realised, upon changing the name from "Blog" to "News" to have the path MySite/News the error is thrown, the Lee solution worked (with the postDate property included) but the post remains at the root.
Ok, third post about this. I have figured out a way to avoid this error.
Keeping the original instalation, no dll mod or changing the datatype. Try first to save without publishing, then preview the post, then save and publish.
This worked using the content folder to create the blog. Haven't tried using the example blog that you create after installing the package then renaming and/or moving it around.
I see others mention a similar problem here, but I just noticed it: when creating a blog post it no longer uses the date folders; it just puts it in the root.
Yes I get the same as Tim but on Saving and Publishing it does put it under the correct date structure.
Is this by design? I can see it as a useful(ish) feature!
Yes, that's by design. I'm assuming it's because the date folder should really match the date the post is published, not the date it was created.
Hmmmm... That is not matching the behaviour I get. For me it does not go into the date folders upon publishing; it remains in the root of the blog.
I tried this and worked like a charm. Just make sure the PostDate property has leading caps.
I have one little problem trying to follow this, my Umbraco install won't let me have the leading caps; it changes it on me automatically. Is this a setting in the config?
Yeah, this is also something I experienced, I guess this is by design in version 4.5. What I did was to modify the Blog Post doc type in a 4.0.2 version and then imported it to the current one.
ok, I managed to change the postDate to PostDate in the database, but it still won't publish to the date folders on publish.
You still have the modified Umlaut.Umb.Blog.dll and Umlaut.Umb.Blog.pdb in the bin folder? If so, I would suggest to change them back to originals and try again.
Yeah, putting back the original DLLs just gives me the original error this post started out with. This is exceptionally frustrating.
Ok, I figured it out! I needed to enable the Date Folder as a document type that could be created under the blog. It was not on by default. When I turned it on, posts now create the date folder that matches the PostDate.
Thank you to all who tried to help me.
I can't find any way to moderate comments on this version; apparently they should be listed in the Content dashboard but I see nothing.
Anyone else have the same issue?
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted