mvc Ensure that HttpConfiguration.EnsureInitialized()

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的路由器

posted @ 2017-05-04 10:04  ☆♂安♀★  阅读(749)  评论(0编辑  收藏  举报