SimpleWithWebApplicationBuilderTests.HelloWorld
See original GitHub issueError Message
System.ObjectDisposedException : Cannot access a disposed object.
Object name: 'IServiceProvider'.
Stacktrace
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() in Microsoft.Extensions.DependencyInjection.dll:token 0x600011e+0xa
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) in Microsoft.Extensions.DependencyInjection.dll:token 0x6000067+0x8
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType) in Microsoft.Extensions.DependencyInjection.dll:token 0x6000062+0x0
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) in Microsoft.Extensions.DependencyInjection.Abstractions.dll:token 0x6000094+0x34
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) in Microsoft.Extensions.DependencyInjection.Abstractions.dll:token 0x6000095+0xe
at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.ConfigureHostBuilder(IHostBuilder hostBuilder) in /_/src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs:line 202
at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.EnsureServer() in /_/src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs:line 172
at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateDefaultClient(DelegatingHandler[] handlers) in /_/src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs:line 462
at Microsoft.AspNetCore.Mvc.FunctionalTests.SimpleWithWebApplicationBuilderTests..ctor(MvcTestFixture`1 fixture) in /_/src/Mvc/test/Mvc.FunctionalTests/SimpleWithWebApplicationBuilderTests.cs:line 16
Build
@davidfowl I’m concerned this happened on the first official build with your changes to WebApplicationFactory https://github.com/dotnet/aspnetcore/pull/33462/.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Supporting integration tests with WebApplicationFactory in ...
In this post I look at the changes that were made to WebApplicationFactory to support minimal hosting APIs with WebApplicationBuilder in .
Read more >Code samples migrated to the new minimal hosting model ...
CreateBuilder initializes a new instance of the WebApplicationBuilder class with preconfigured defaults. For more information, see ASP.
Read more >Exploring the code behind WebApplicationBuilder
In this post we're going to look at the code behind them, to see how they achieve a simpler API, while still having...
Read more >Tutorial: Create a minimal API with ASP.NET Core
Learn how to build a minimal API with ASP.NET Core.
Read more >Integration Testing ASP.NET Core 6 WebAPI Applications
Learn a simple way to create integration tests for ASP. ... On the default route, the API returns “Hello World”, and for the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh snap! Very nice
Should be fixed by https://github.com/dotnet/aspnetcore/pull/33479