Git Product home page Git Product logo

dd4t.di.autofac's Introduction

AppVeyor

AppVeyor

dd4t-di-autofac

Autofac dependency injection container

Release 2.5

  • Upgraded reference to DD4T.Core
  • Suppress warnings about obsolete methods in IComponentProvider

How to

  1. Install Nuget package: Install-Package DD4T.DI.Autofac http://www.nuget.org/packages/DD4T.DI.Autofac
  2. Add DD4T.DI.Autofac namespace to your usings;
  3. Call the UseDD4T method on your Autofac Autofac.ContainerBuilder class.
var builder = new ContainerBuilder();
//set all your custom apllication binding here.
builder.UseDD4T();
builder.Build();

UseDD4T will Register all default class provided by the DD4T framework.

If you need to override the default classes: (i.e. the DefaultPublicationResovler) Register your class before the method call UseDD4T

var builder = new ContainerBuilder();
//set all your custom apllication binding here.
builder.RegisterType<MyCustomPublicationResovler>().As<IPublicationResolver>().SingleInstance();
builder.UseDD4T();
builder.Build();

dd4t.di.autofac's People

Contributors

sshibani avatar quirijnslings avatar thijsborst avatar 100000001 avatar guzzter avatar albertromkes avatar ehenderiks avatar

Watchers

James Cloos avatar  avatar  avatar Rick Pannekoek avatar  avatar Mihai Cădariu avatar Jonathan Williams avatar Rogier Oudshoorn avatar Josh Einhorn avatar  avatar

dd4t.di.autofac's Issues

Bootstrap only works in a web application

If there is no 'bin' folder, the bootstrap code returns without setting any dependencies.

This must be fixed in Bootstrap.cs as well as Mvc.cs!

NOTE: the same applies probably to the Unity and Ninject projects (but I haven't checked this).

IIS is locking the provider DLL

The DI Bootstrap needs to load the provider DLL in the bin folder to make sure IIS copies it to the Temporary ASP.NET folder. As a result, IIS locks the provider DLL.
This issue appears in all DI projects.

Autofac.MVC5 dependency instead of Autofac

In the nuspec file Autofac.MVC5 is listed as a dependency and I don't think it's necessary.

If you're creating a Web API you don't need Autofac.MVC5, but because of this nuget package you must add it. Can the dependency be changed to Autofac?

Could not find bin folder when performing unit test with NUnit

When using this nuget to set up autofac for unit testing it's not working. It's searching for the assemblies in the wrong (non-existant) folder.

AppDomain.CurrentDomain.BaseDirectory is already pointing to the bin folder, so adding "bin" to the end here:
var binDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin");
results in "/bin/bin" as the path when unit testing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.