Open mehdihadeli opened 1 year ago
You can't extend the application when you override configure. We should probably throw here.
@davidfowl Why do we have this method on WebHostBuilder? Because on internal hosting process of aspnetcore? What is the usage of this Configure method?
It's been around since ASP.NET Core 1.0 and it's the way the application was configured we built the new hosting API.
Ok thanks :)
I think if override Program Configure
functionality is not allowed, framework should throw an exception here, but both Program Configure and my override Configure in WebAppFactory run without any error. I just can catch the exception when I call my app endpoint with WebAppFactory httpclient and I get NotFound error.
This is a breaking change. Not saying we can't do it, but it requires doing research to understand if this will break any mainline scenarios.
Triage: We can consider logging an error here as an alternative to throwing an exception but that might have poor visibility to users.
As mentioned, need to do more research into impact of exception.
It might help to clarify this in the docs as well as part of https://github.com/dotnet/AspNetCore.Docs/issues/27844.
Thanks for contacting us.
We're moving this issue to the .NET 8 Planning
milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
@captainsafia Is the docs part of this done with https://github.com/dotnet/AspNetCore.Docs/issues/27844 or is there more docs work here?
Nope, this particular note wasn't addressed in the linked issue. We'll need to add a new note about this behavior. Likely on this page.
bellow custom factory for E2E test:
The repo of the link is absent - 404 . Sad. I need details.
Why would you use "UseHttpsRedirection"? WebApplicationFactory client doesn't use SSL.
Is there an existing issue for this?
Describe the bug
Hi, I create bellow custom factory for E2E test:
Also, this is my Program file:
When I want to call
WeatherForecast
GET endpoint, with WebApplicationFactoryClient
I getNotFound
response from client in my test instead ofOK
If I remove below section from My CustomFactory my http client returns OK status code
Expected Behavior
I Expect to get a 200 ok status code for this http call on http client
Steps To Reproduce
Run this test
Exceptions (if any)
.NET Version
7.0.0
Anything else?
No response