Copied to clipboard

Flag this post as spam?

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


  • Terry Clancy 204 posts 944 karma points
    Aug 31, 2020 @ 20:53
    Terry Clancy
    0

    Umbraco 8 Composing causing BootFailedException

    Hi All,

    I am trying to use Umbraco 8 Composing to run code at startup, but the boot is failing with this error and breaking at line 223 of CoreRuntime.cs

    Exception thrown: 'Umbraco.Core.Exceptions.BootFailedException' in Umbraco.Core.dll
    Exception thrown: 'Umbraco.Core.Exceptions.BootFailedException' in Umbraco.Core.dll
    

    Here is my Composing code which is based on the example HERE . Without this code, Umbraco Starts OK. So this code is causing the Boot Failure. Any assistance resolving this would be much appreciated:

    using System.Linq;
    using Umbraco.Core;
    using Umbraco.Core.Composing;
    using Umbraco.Core.Events;
    using Umbraco.Core.Services;
    using Umbraco.Core.Services.Implement;
    
    namespace TeraTastic.TT_Classes
    {
        //  Clancy: Added following line 8/26/2020 as suggested at https://codeshare.co.uk/blog/how-to-fix-the-umbraco-core-exceptions-bootfailedexception/
        // [RuntimeLevel(MinLevel = RuntimeLevel.Run)]
        public class TT_Startup_Composer : IUserComposer
        {
            public void Compose(Composition composition)
            {
                // Append our component to the collection of Components
                // It will be the last one to be run
                composition.Components().Append<TT_Startup_Component>();
            }
        }
    
        public class TT_Startup_Component : IComponent
        {
            // Initialize: It will run once when Umbraco starts
            public void Initialize()
            {
                int i = 0;
                i++;
                i++;
                ////Listen for when content is being saved
                //var myTT_Startup = new TT_Startup();
                //// myTT_Startup.Startup(umbracoApplication, applicationContext);
                //myTT_Startup.Startup();
            }
    
            public void Terminate()
            { }
        }
    }
    

    Thanks Terry Clancy ClanceZ

  • Terry Clancy 204 posts 944 karma points
    Sep 01, 2020 @ 06:28
    Terry Clancy
    101

    Hi all,

    I fixed this by including the line

    [RuntimeLevel(MinLevel = RuntimeLevel.Run)]
    

    before the line

    public class TT_Startup_Composer : IUserComposer
    

    Thanks

    Terry Clancy ClanceZ

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies