Skip to content
Discussion options

You must be logged in to vote

Hi! 👋

What you’re seeing is expected behavior with top-level route registrations in ASP.NET Core 7+. Here’s why:

  1. EndpointDataSource behavior changed
  • When you use app.UseEndpoints(...), all endpoints are registered in the central EndpointDataSource, which your test can inspect.
  • With top-level route registrations (like app.MapControllers() and app.MapMyMinimalApis()), the endpoints are still created, but they are not collected in the same EndpointDataSource used by UseEndpoints.
  • This is why your EndpointDataSource appears empty — it’s not obsolete, it’s just no longer populated in the same way for minimal APIs.
  1. Replacement approach
  • You can still inspect the endpoints by injecting IEn…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@RichardD2
Comment options

Answer selected by RichardD2
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants