Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8829447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:50:07+00:00 2026-06-14T07:50:07+00:00

I am trying to use Ninject to resolve my dependency in my DelegatingHandler in

  • 0

I am trying to use Ninject to resolve my dependency in my DelegatingHandler in asp.net web api.

I am registering the custom delegating handler in global.asax as follows:

GlobalConfiguration.Configuration.MessageHandlers.Add(
            DependencyResolver.Current.GetService<AuthorizationHeaderHandler>());

I am wondering what’s the lifetime of MessageHandlers? does it even make sense to use IoC container to inject the dependencies in delegating handler?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:50:08+00:00Added an answer on June 14, 2026 at 7:50 am

    Delegating handlers are initialized only once, in application start.
    Think of them as in-process intermediaries rather than part of a single request/response lifecycle.

    If you want this to be changed – there is a work item open to change this at Codeplex – http://aspnetwebstack.codeplex.com/workitem/62 you can vote for the feature and it might be brought into Web API vNext.

    For the time being, the best bet to inject anything into the handler is manually resolving dependency, so using (unfortunately) Service Location.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use Ninject 2.0 with Asp .Net 3.5 web application. Following
In trying to configure ServiceStack.net to use Ninject as its IOC, I am getting
I'm trying to use Ninject to provide my custom MembershipProvider with an instance of
I am trying to set up my ASP.NET Web Forms (Framework 4.0) application to
I am trying to get an ASP.Net MVC2 app to display a simple custom
We're trying to use MEF 2 with ASP.NET MVC 4 to support an extensible
I am trying to self bind MembershipProvider in ASP.NET MVC 2 and then use
.. but not k.i.s.s.i.n.g I am trying to use NInject with NHibernate. Through NuGet
I am trying to properly use Ninject to inject log4net logging into my MVC3
i'm trying use facebook API to upload photo in my fan page. I downloaded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.