Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • karen 186 posts 461 karma points
    Nov 19, 2014 @ 18:31
    karen
    0

    ContentLastChanceFinderResolver error - Resolution is frozen, it is not possible to configure it anymore.

    I am trying to learn how to use IContentFinder for a page not found scenario.

    Umbraco v6.2.1 (Assembly version: 1.0.5261.28997)

    Trying to hook it into the application start up, I get an error:

    Server Error in '/' Application.

    Resolution is frozen, it is not possible to configure it anymore.

    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.InvalidOperationException: Resolution is frozen, it is not possible to configure it anymore.

    Source Error: 

    Line 9:           //On application starting event...
    Line 10:            //Add to the ContentFinder resolver collection our custom 404 Content Finder resolver
    Line 11:          ContentLastChanceFinderResolver.Current.SetFinder(new NotFoundContentFinder());
    Line 12:             base.ApplicationStarting(umbracoApplication, applicationContext);
    Line 13:         }

     

    here is my code:

    using Umbraco.Core;
    using Umbraco.Web.Routing;

    namespace WHRX.Helpers
    {
        public class RegisterEvents : ApplicationEventHandler {
            protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) {
    //On application starting event...
    //Add to the ContentFinder resolver collection our custom 404 Content Finder resolver
    ContentLastChanceFinderResolver.Current.SetFinder(new NotFoundContentFinder());
    base.ApplicationStarting(umbracoApplication, applicationContext);
            }
        }
    }

     

    Feeling stumped and having a really hard time implementing this!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 19, 2014 @ 22:57
    Jan Skovgaard
    1

    Hi Karen

    I have no experience with what you're doing above but I'm wondering if you have read this documentation or if it might help http://our.umbraco.org/documentation/Reference/Events/application-startup

    Don't know if the information in this old google groups discussion might help? https://groups.google.com/forum/#!topic/umbraco-dev/putnStjFp_E

    /Jan

  • karen 186 posts 461 karma points
    Nov 19, 2014 @ 23:43
    karen
    0

    Hi Jan,

    Thanks.  I did look at that page, I have also been looking at the following to figure out how to get this done:

    http://our.umbraco.org/documentation/Reference/Request-Pipeline/IContentFinder

    and this thread:

    http://our.umbraco.org/forum/developers/extending-umbraco/43866-Alternatives-to-404-in-umbracosettingsconfig

     

    Pretty much followed those examples to come up with what I have (haven't done anythign original yet, just trying to get the examples to work!)

    Possibly need a better title to this thread, referrering to IContentFinder and 404 pages, but can't change it now.

  • karen 186 posts 461 karma points
    Nov 20, 2014 @ 19:09
    karen
    101

    Ah found my error - I was using 

    ApplicationStarted

    and should have been using

    ApplicationStarting

    Cut and paste from the wrong place somewhere!

Please Sign in or register to post replies

Write your reply to:

Draft