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 7763647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:42:43+00:00 2026-06-01T14:42:43+00:00

I have an configuration error with Unity. I am trying to implement http://unitymvc3.codeplex.com/ ,

  • 0

I have an configuration error with Unity.
I am trying to implement http://unitymvc3.codeplex.com/, but i am stucked right now, because of this:

In my unity configuration I have this settings:

<register type="IMainDbContext" mapTo="WorkflowContext">
    <lifetime type="hierarchical" />
    <constructor></constructor>
  </register>

But at the time of creating unity, (my simple code is here:)

UnityConfigurationSection section = ConfigurationManager.GetSection("unity") as UnityConfigurationSection;
        if (section != null)
        {
            section.Configure(container);
        }

        this.container = container;

everything is configured great, except of registration “IManDbContext” which has LifetimeManagerType = {Name = "TransientLifetimeManager" FullName = "Microsoft.Practices.Unity.TransientLifetimeManager"}, but it should be hierarchical lifetime manager

Have you got any ideas how tell unity (in configuration, not in code) i want hierarchical lifetime manager?
Thanks for any tips.

  • 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-01T14:42:44+00:00Added an answer on June 1, 2026 at 2:42 pm

    My error was caused by this error:
    I have multiple DbContext, but they was badly configured:

    <register type="IMainDbContext" mapTo="WorkflowContext">
        <lifetime type="hierarchical" />
        <constructor></constructor>
    </register>
    
    <register type="IReportDbContext" mapTo="SomeBadContext">
        <lifetime type="hierarchical" />
        <constructor></constructor>
    </register>
    

    When I was using this configuration, which was bad, unity simple don`t configure any lifetime manager. After I set these context right, unity used my lifetime manager configurations just right.

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

Sidebar

Related Questions

I have a Java project I am building with Maven. I am now trying
I have configuration values saved in an app.config . I want to create a
I'm working in xmldataprovider and we have configuration value source this value may be
I have a configuration file where a developer can specify a text color by
We have certain configuration files which we want to be in version control as
I have some configuration data in a config file that I read off disk
I have a configuration file that I consider to be my base configuration. I'd
I have a configuration file in the following JSON format: { key1: value1, key2:
We have some configuration options for the rename detection heuristics during diff ( log
In my DefaultRegistry I have this configuration: ForRequestedType<INHUnitOfWork>().CacheBy(InstanceScope.HttpContext) .TheDefault.Is.OfConcreteType<NHibernateUnitOfWork>(); At some point in the

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.