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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:07:42+00:00 2026-05-20T23:07:42+00:00

At work, we use Unity a lot. It’s great at it’s job, but the

  • 0

At work, we use Unity a lot. It’s great at it’s job, but the more you use it, the more your configuration file grows, the more runtime issues increase and the more you have to recreate your unity configuration for each test project.

So we end up with a huge unity configuration section that has to be duplicated accross several projects and when it comes time to deploy, you end up having to track down dlls that you forgot to add references to, but you only discover these at runtime. Not fun.

I’m guessing someone has come across this issue and has a solution. Ideally, I would like to figure out how to configure Unity in a way that makes use of convention over configuration and reduces runtime issues (ie, huge configuration files). Anyone know of a good way to implement Unity with minimal configuration?

Edit: One thing: I have to stick with only using Unity. Can’t really switch to Ninject, etc.

  • 1 1 Answer
  • 3 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-05-20T23:07:43+00:00Added an answer on May 20, 2026 at 11:07 pm

    Unity has a configuration API so it’s pretty easy to write some auto-configuration code using reflection.

    Several people have blogged about it here:

    http://geekswithblogs.net/watsonjon/archive/2009/09/28/unity-convention-based-registration.aspx

    http://geekswithblogs.net/brians/archive/2010/07/04/convention-based-registration-extension-for-the-microsoft-unity-ioc-container.aspx

    Including this one with some framework code you can reuse:

    http://thedersen.com/2011/02/20/convention-based-configuration-for-microsoft-unity/

    This has been discussed on the Unity discussion board. The issue is that everyone wants different conventions. Look at the blog posts, writing your own seems pretty trivial.

    • 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 the Unity IoC with the unit of work &
I have a reference application that I use to work through DDD issues, and
I use a unit of work pattern a lot in my flex projects. I'll
At work we use a common makefile that other makefiles include (via the include
At work we use a branching strategy where all changes start off in a
Where I work we use a set schedule to build our applications. What is
I have a website hosted with godaddy. Basically for my work I use TFS.
I know this code use to work, I must have accidentally changed something when
What Tools do you people use to work with Scala? For my learning phase,
dblink does not seem to work when I use a named connection to a

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.