Skip to content

Get Started Problem #38

Closed
Closed
@AndGa

Description

@AndGa
  1. Create .Net Core 2.2 Web App:
    dotnet new webapp
  2. Add NuGet Package:
    Install-Package Unity.Microsoft.DependencyInjection
  3. Customize Program:
    WebHost.CreateDefaultBuilder(args) .UseUnityServiceProvider() .UseStartup<Startup>();
  4. Customize Startup:
    services.AddMvc() .SetCompatibilityVersion(CompatibilityVersion.Version_2_2) .AddControllersAsServices();
  5. Run:
    dotnet run

I have got:
Application startup exception: System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Reverse[TSource](IEnumerable1 source) at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6] Application startup exception System.ArgumentNullException: Value cannot be null. Parameter name: source at System.Linq.Enumerable.Reverse[TSource](IEnumerable1 source)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

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.Internal.WebHost.StartAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
at _3.Program.Main(String[] args) in D:\TEMP\3\Program.cs:line 18

A similar problem is described here: #17

What have i done wrong?

FYI:
i have the problem with 5.9.2. (current release)
but not with 5.9.0.

Metadata

Metadata

Assignees

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