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!
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:
Feeling stumped and having a really hard time implementing this!
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
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.
Ah found my error - I was using
and should have been using
Cut and paste from the wrong place somewhere!
is working on a reply...