Skip to content

System.ArgumentNullException: Value cannot be null. #17

@walterfranssen

Description

@walterfranssen

Unity.Microsoft.DependencyInjection gives exception if running in a docker container.

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Reverse[TSource](IEnumerable`1 source)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()

Docker image is microsoft/aspnetcore:2.0

Program.cs
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}

    public static IWebHost BuildWebHost(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .UseUnityServiceProvider()
            .UseStartup<Startup>()
            .Build();
}

Startup.cs
public virtual void ConfigureContainer(IUnityContainer container)
{

        container.RegisterType<ITest, Test>();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions