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

  • Home
  • SEARCH
  • 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 7607903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:47:06+00:00 2026-05-31T00:47:06+00:00

Possible Duplicate: Ioc/DI – Why do I have to reference all layers/assemblies in entry

  • 0

Possible Duplicate:
Ioc/DI – Why do I have to reference all layers/assemblies in entry application?

I’ve decided to build a new MVC 3 application using Autofac as the DI container.

Since all my container configuration is done within the MVC project it forces a reference to all layers e.g. Data, which ideally the web project should have no idea about.

Is there a simple way to move this to a separate “fabric” class library? The problem I’m encountering is that I can’t then configure the controllers in the fabric project as it would result in a circular reference between Fabric and MVC projects.

I understand that the reference is only used for configuration but not having the references will ensure a naughty developer doesn’t start referencing the classes directly.

On a related note does anyone have any feelings about abstracting their DI container – or is this just getting carried away! As a rule of thumb I think it’s good practise to wrap third party assemblies but at this level?

Thanks in advance,

Tom.

  • 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-05-31T00:47:07+00:00Added an answer on May 31, 2026 at 12:47 am

    Since all my container configuration is done within the MVC project it
    forces a reference to all layers e.g. Data, which ideally the web
    project should have no idea about.

    If you don’t reference those layers, how do you expect the corresponding assemblies end up in your bin folder at runtime? You shouldn’t be worried for referencing those layers in the MVC application.

    but not having the references will ensure a naughty developer doesn’t
    start referencing the classes directly.

    You should teach your developers good practices.

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

Sidebar

Related Questions

Possible Duplicate: What is IOC? Need some practical code examples to illustrate I have
Possible Duplicate: Using IoC for Unit Testing I think I do have a Problem
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: How does the Google Did you mean? Algorithm work? Suppose you have
Possible Duplicate: PHP get all arguments as array? Within a javascript function arguments always
Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: php == vs === operator Reference - What does this symbol mean
Possible Duplicate: How to call a JavaScript function from PHP? I have a php
Possible Duplicate: C#: How to reference generic classes and methods in xml documentation I
Possible Duplicate: Filetype association with application (C#) I'm writing a C# Windows app to

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.