httpConfiguration ensureInitialized error?
See original GitHub issueHi hikalkan, When i upgrade my project to abp 0.8.0.1, now i got the following exception:
{
"message": "An error has occurred.",
"exception_message": "The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all other initialization code.",
"exception_type": "System.InvalidOperationException",
"stack_trace": " 在 System.Web.Http.Routing.RouteCollectionRoute.get_SubRoutes()\r\n 在 System.Web.Http.Routing.RouteCollectionRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage request)\r\n 在 System.Web.Http.HttpRouteCollection.GetRouteData(HttpRequestMessage request)\r\n 在 System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 Abp.WebApi.Controllers.ResultWrapperHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Web.Http.Owin.PassiveAuthenticationMessageHandler.<SendAsync>d__0.MoveNext()\r\n--- 引发异常的上一位置中堆栈跟踪的末尾 ---\r\n 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n 在 System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()"
}
I have see the issue[https://github.com/aspnetboilerplate/aspnetboilerplate/issues/850], it have fixed by this update, why do I have this error?
Issue Analytics
- State:
- Created 8 years ago
- Comments:31 (13 by maintainers)
Top Results From Across the Web
Ensure that HttpConfiguration.EnsureInitialized()
I've installed Visual Studio 2013 and when I run my app I get the error below. I've got no idea as to where...
Read more >The object has not yet been initialized. Ensure that ...
3', I'm now facing the following error when calling my own Web API: The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() ......
Read more >The object has not yet been initialized. Ensure that ...
The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all ...
Read more >Ensure that HttpConfiguration.EnsureInitialized() is called ...
Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all other initialization code.
Read more >[Solved]-Ensure that HttpConfiguration.EnsureInitialized()-C#
in my case i created the webservice in project a and started it from project b and i got exactly this error. the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I discovered that if there is a problem in route configuration attributes, Web Api gives this error, it is very misleading. If you put config.EnsureInitialized(); end of your StartUp.Configuration() method, you can see the real underlying exception in a debug session.
Hi @ColinZeb,
The error message “InvalidOperationException:valuefactory attempted to access the value property of this instance” is related to OData I think. Since you didn’t configure Odata with ABP, the exception is not thrown by ABP in this project https://github.com/ColinZeb/OwinTest/. By the way, thank you for that demonstration, it helped a lot 😃.
I have applied the stes
Can you try it ? If it does not work for you, please open another issue for that.
Thanks.