question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

httpConfiguration ensureInitialized error?

See original GitHub issue

Hi 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:closed
  • Created 8 years ago
  • Comments:31 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
Serguzestcommented, Jun 22, 2016

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.

1reaction
ismcagdascommented, Mar 2, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found