-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Labels
Milestone
Description
I am planning to move to asp.net core 3.0, but I got an error message which sounds to be due to breaking changes in asp.net core 3.0.
Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'Microsoft.Extensions.DependencyInjection.ServiceCollection' to type 'Grace.DependencyInjection.IInjectionScope'.
at Microsoft.Extensions.Hosting.Internal.ConfigureContainerAdapter`1.ConfigureContainer(HostBuilderContext hostContext, Object containerBuilder)
at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at dry_test.Program.Main(String[] args) in /../Program.cs:line 20
Startup.cs file:
// omitted code
public void ConfigureContainer(IInjectionScope scope)
{
scope.SetupMvc();
scope.Configure(c=> c.Export<SampleService>().As<ISample>());
}
// omitted codeProgram.cs file:
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.UseGrace();
});Any changes I need to make, or should wait until final version of 3.0?