Difference between RouteTable.Routes and HttpConfi

2019-05-05 07:22发布

I am wondering why routes seem to be configurable from both the HttpConfiguration object and the RouteTable class? Clearly the two .Routes properties are not of the same type, but they seem to stay in-sync. Is there a chance they could get out-of-sync? I'm wondering though, from a Web API perspective, should RouteTable.Routes ever be used?

1条回答
Ridiculous、
2楼-- · 2019-05-05 07:46

The HttpConfiguration class is specific to WebApi making it reusable outside of IIS (e.g. For self hosting). The RouteTable version is for IIS only.

查看更多
登录 后发表回答