Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8511951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:08:53+00:00 2026-06-11T04:08:53+00:00

Im using umbraco v 4.7.1 (Assembly version: 1.0.4281.20201) and have a project where I

  • 0

Im using umbraco v 4.7.1 (Assembly version: 1.0.4281.20201) and have a project where I must extend the global.asax file.

Please not the following

  • I have tried this, http://blog.mattbrailsford.com/2010/07/11/registering-an-application-start-event-handler-in-umbraco/, didn’t work in 4.7
  • it is Global.asax I need to extend since I’m working with dependency injection
  • I cannot delete the App_global.asax.dll file (as some may suggest) since it will regenerate everytime I restart or rebuild my project

Here is my implementation,

using Project.Umbraco.DependencyInjection;
using Project.Umbraco.IoC;
using Microsoft.Practices.Unity;
using System;
using System.Diagnostics;
using umbraco;

namespace Project.Umbraco.App_Start
{
    public class MyGlobal : Global, IContainerAccessor
    {
        /// 

        /// Returns the IoC container
        /// IContainerAccessor
        /// 

        public IUnityContainer Container
        {
            get
            {
                return MvcUnityContainer.Instance.Container;
            }
        }

        protected override void Application_Start(object sender, EventArgs e)
        {
            base.Application_Start(sender, e);
            Debug.WriteLine("Application start");
        }

        protected override void Application_BeginRequest(object sender, EventArgs e)
        {
            base.Application_BeginRequest(sender, e);
            Debug.WriteLine("Application start");
        }
        //protected void Session_Start(object sender, EventArgs e) {}
        //protected void Application_AuthenticateRequest(object sender, EventArgs e) {}
        //protected void Application_Error(object sender, EventArgs e) {}
        //protected void Session_End(object sender, EventArgs e) {}
        //protected void Application_End(object sender, EventArgs e) {}
    }
}

The implementation seems as if should work, maybe I’ve just placed this in the wrong namespace or something?

Thanks for any help

T

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:08:54+00:00Added an answer on June 11, 2026 at 4:08 am

    From Umbraco 4.8.0 and onwards, the App_global.asax.dll is no longer needed, so you might want to consider upgrading to a newer version.

    In 4.7 though, you could simply use the PreApplicationStart method by creating a class that looks a little something like this:

    using System.Linq;
    using System.Web.Routing;
    using System.Web.Http;
    using CustomerName.Extensions;
    
    [assembly: System.Web.PreApplicationStartMethod(typeof(AppStart), "PreStart")]
    namespace CustomerName.Extensions
    {
        public static class AppStart
        {
            public static void PreStart()
            {
                RouteTable.Routes.MapHttpRoute(
                   name: "DefaultApi",
                   routeTemplate: "api/{controller}/{id}",
                   defaults: new { id = RouteParameter.Optional }
               );
            }
        }
    }
    

    Of course, instead of defining WebAPI routes, you could insert your DI code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project which is using umbraco cms, ie. MSSQL (Now we are
Okay; using the Umbraco CMS I have a xslt menu being generated in the
I'm new to Umbraco. I am using Umbraco 5 RC2. I have noticed that
I've been trying to install Umbraco using the Microsoft Web Platform Installer. I'm not
When using the latest Release version (4.0.4.2) of Umbraco, the tinymce3 control fails to
I am using umbraco v4.7.0. I have created a Macro for a Usercontrol.ascx and
I have a problem with publishing a blog (Umbraco CMS) using web matrix. It
@inherits umbraco.MacroEngines.DynamicNodeContext @using System.Collections; @{ List<string> qa = new List<string>(); } //this is not
I'm using Umbraco 4.7.1 and have created a custom DocumentType called Partner. I want
I'm currently working on a project using Umbraco and the client has asked for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.