Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Throw a nicer error when the routing services haven't been added to DI #276

Closed
DamianEdwards opened this issue Jan 11, 2016 · 9 comments
Closed
Assignees
Milestone

Comments

@DamianEdwards
Copy link
Member

Like other parts of the framework we should throw a nice helper exception when services are missing from DI, including the sample call the app needs to add the routing services to DI, e.g.

Routing services have not been registered. Register services by calling 'IServices.UseRouting()'.
@DamianEdwards
Copy link
Member Author

@rynowak @Eilon

@Eilon
Copy link
Member

Eilon commented Jan 11, 2016

MVC already does this. We can follow the same model.

@Eilon Eilon added this to the 1.0.0-rc2 milestone Jan 11, 2016
@rynowak
Copy link
Member

rynowak commented Jan 11, 2016

Can we not follow the same model instead? It would be nice to do this on Startup instead of on first request

@Eilon
Copy link
Member

Eilon commented Jan 11, 2016

Hmm ok, do we have an idea of how to do that?

@rynowak
Copy link
Member

rynowak commented Jan 11, 2016

We can register a marker service and have the routing middleware resolve it when created.

@DamianEdwards
Copy link
Member Author

Ya, the code linked to above does this.

@rynowak
Copy link
Member

rynowak commented Jan 11, 2016

MVC does it on first request - we should think about changing it to do it when we add AddMvc.

@Eilon
Copy link
Member

Eilon commented Jan 11, 2016

@javiercn you got that? Let's add this to Routing, and then also change MVC to do the same. I logged aspnet/Mvc#3907 and assigned to you.

@javiercn
Copy link
Member

@Eilon will do it for routing and mvc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants