Dependency Injection on Global.asax compilation error
<p>I'm having compilation error when calling my service in global.asax. Im using UnityMvc as my DI. It was working when called in my controllers but no in Global.asax. Here is the error.</p>

<blockquote>
  <p>Compiler Error Message: CS7036: There is no argument given that corresponds to the required formal parameter 'genreService' of 'MvcApplication.MvcApplication(IGenreService)'</p>
</blockquote>

<p><strong>Global.asax.cs</strong></p>

<pre><code>public class MvcApplication : System.Web.HttpApplication
{
    private readonly IGenreService _genreService;

    public MvcApplication(IGenreService genreService)
    {
        _genreService = genreService;
    }

    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }
}
</code></pre>

<p><strong>GenreService.cs</strong></p>

<pre><code>public partial class GenreService : IGenreService
{
    private readonly IRepository&lt;Genre&gt; _genreRepository;
    private readonly IRepository&lt;GameGenre&gt; _gameGenreRepository;

    public GenreService(IRepository&lt;Genre&gt; genreRepository, IRepository&lt;GameGenre&gt; gameGenreRepository)
    {
        _genreRepository = genreRepository;
        _gameGenreRepository = gameGenreRepository;
    }

    // methods
}
</code></pre>

<p><strong>IGenreService.cs</strong></p>

<pre><code>public partial interface IGenreService
{
    // interface
}
</code></pre>

<p><strong>UnityConfig.cs</strong></p>

<pre><code>using System;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using System.Data.Entity;
using Microsoft.AspNet.Identity;
using Microsoft.Owin.Security;
using GameCommerce.Infrastructure.Services.GameLibrary;
using GameCommerce.Infrastructure;
using Microsoft.AspNet.Identity.EntityFramework;
using GameCommerce.Infrastructure.ApplicationUsers;
using System.Web;
using GameCommerce.Infrastructure.Services.Message;

namespace GameCommerce.Web.App_Start
{
/// &lt;summary&gt;
/// Specifies the Unity configuration for the main container.
/// &lt;/summary&gt;
public class UnityConfig
{
    #region Unity Container
    private static Lazy&lt;IUnityContainer&gt; container = new Lazy&lt;IUnityContainer&gt;(() =&gt;
    {
        var container = new UnityContainer();
        RegisterTypes(container);
        return container;
    });

    /// &lt;summary&gt;
    /// Gets the configured Unity container.
    /// &lt;/summary&gt;
    public static IUnityContainer GetConfiguredContainer()
    {
        return container.Value;
    }
    #endregion

    /// &lt;summary&gt;Registers the type mappings with the Unity container.&lt;/summary&gt;
    /// &lt;param name="container"&gt;The unity container to configure.&lt;/param&gt;
    /// &lt;remarks&gt;There is no need to register concrete types such as controllers or API controllers (unless you want to 
    /// change the defaults), as Unity allows resolving a concrete type even if it was not previously registered.&lt;/remarks&gt;
    public static void RegisterTypes(IUnityContainer container)
    {
        // NOTE: To load from web.config uncomment the line below. Make sure to add a Microsoft.Practices.Unity.Configuration to the using statements.
        // container.LoadConfiguration();

        // TODO: Register your types here
        // container.RegisterType&lt;IProductRepository, ProductRepository&gt;();

        container.RegisterType&lt;DbContext, ApplicationDbContext&gt;(new HierarchicalLifetimeManager());
        container.RegisterType&lt;UserManager&lt;ApplicationUser&gt;&gt;(new HierarchicalLifetimeManager());
        container.RegisterType&lt;IUserStore&lt;ApplicationUser&gt;, UserStore&lt;ApplicationUser&gt;&gt;(new InjectionConstructor(new ApplicationDbContext()));
        container.RegisterType&lt;Areas.Admin.Controllers.AccountController&gt;(new InjectionConstructor());
        container.RegisterType&lt;Controllers.AccountController&gt;(new InjectionConstructor());
        container.RegisterType&lt;IAuthenticationManager&gt;(new InjectionFactory(o =&gt; HttpContext.Current.GetOwinContext().Authentication));

        container.RegisterType(typeof(IRepository&lt;&gt;), typeof(Repository&lt;&gt;));
        container.RegisterType&lt;IGameService, GameService&gt;();
        container.RegisterType&lt;IGenreService, GenreService&gt;();
        container.RegisterType&lt;IGameDeveloperService, GameDeveloperService&gt;();
        container.RegisterType&lt;IGamePublisherService, GamePublisherService&gt;();
        container.RegisterType&lt;IMessageService, MessageService&gt;();
    }
}
}
</code></pre>