The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all other initialization code.

 

在 System.Web.Http.Routing.RouteCollectionRoute.get_SubRoutes() 在 System.Web.Http.Routing.RouteCollectionRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage request) 在 System.Web.Http.WebHost.Routing.HttpWebRoute.GetRouteData(HttpContextBase httpContext)

原因是 GlobalConfiguration.Configure()没有配置好webapi的路由器

相关文章: