roblevine/UnityLog4NetExtension

Assembly generation failed -- Referenced assembly 'UnityLog4NetExtension' does not have a strong name

Closed this issue · 1 comments

I add reference to UnityLog4NetExtension to Global.asax.cs and when I want to add new extension I get that error. My code :

protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
InitContainer();
ControllerBuilder.Current.SetControllerFactory(typeof(UnityControllerFactory));
}

    private static void InitContainer()
    {
        if (container == null)
        {
            container = new UnityContainer();
        }

        // Register the relevant types for the 
        // container here through classes or configuration
        container.AddNewExtension<UnityLog4NetExtension.Log4Net.Log4NetExtension>();
    }

Hi,

I'm not clear from your issue whether you are using the source code directly from here on GitHub, or whether you are using the NuGet package.

In either case, the error you are getting is because UnityLog4NetExtension was not strong-named, and yet your projects/solution must be; once one project is strong-named, it is a requirement that all dependent projects are also strong-named.

I hadn't thought about strong-naming before, but now I've updated both the source code and the NuGet package to be strong-named, so please try again: your problem should be resolved.

Thanks,

Rob