The Wayback Machine - https://web.archive.org/web/20211019160614/https://github.com/dotnet/aspnetcore/issues/37680
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.net6 minimal API test config overrides only apply after app has been built #37680

Open
maisiesadler opened this issue Oct 19, 2021 · 0 comments
Open

Comments

@maisiesadler
Copy link

@maisiesadler maisiesadler commented Oct 19, 2021

Describe the bug

Using .net 6 minimal APIs and WebApplicationFactory for testing, the test config override is only applied after .Build.
This means any interaction with config while configuring services using builder.Configuration will be using the app configuration, not test overrides.

To Reproduce

I've created a repo that shows the difference, here is the Program, and an Example test.

Test run

Further technical details

  • ASP.NET Core version: net6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant