Top "Autofac" questions

Autofac is an inversion of control (IoC) container for Microsoft .NET.

How to set ViewBag properties for all Views without using a base class for Controllers?

In the past I've stuck common properties, such as the current user, onto ViewData/ViewBag in a global fashion by …

asp.net-mvc asp.net-mvc-3 autofac viewdata
None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder'

When I try to set a PARAMETER using the Xml Configuration I get the following error: None of the constructors …

c# autofac
Passing parameters to constructors using Autofac

I'm very new to autofac so it's possible that I'm completely misusing it. Let's say I have a class that …

c# autofac
Register partically closed generic type with Autofac

I have UnitofWork class and it implement IUnitOfWork. I try to register that with Autofac: var builder = new ContainerBuilder(); builder .…

c# generics autofac unit-of-work
Autofac None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder'

None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'LMS.Services.Security.EncryptionService' can be invoked …

c# dependency-injection inversion-of-control autofac ioc-container
ASP.NET Core MediatR error: Register your handlers with the container

I have a .Net Core app where i use the .AddMediatR extension to register the assembly for my commands and …

c# asp.net-core autofac mediatr
Autofac with multiple implementations of the same interface

I'm using Autofac and would like to have multiple implementations of an interface. How can I configure Autofac so to …

c# dependency-injection inversion-of-control autofac
How to use Property Injection with AutoFac?

In a Console application, I'm using Log4Net and in the Main method I'm getting the logger object. Now, I'd …

c# asp.net inversion-of-control log4net autofac
An error occurred when trying to create a controller of type 'TypeNewsController'

I have searched long and hard but found nothing that helped yet. Where am I going wrong? I really do …

asp.net-mvc dependency-injection autofac asp.net-apicontroller
How do I resolve Web API controllers using Autofac in a mixed Web API and MVC application?

Hi I have an MVC application where I have defined some dependencies to my Web API. public class AutofacWebApiDependenceResolver : IDependencyResolver { …

c# asp.net-mvc asp.net-mvc-4 asp.net-web-api autofac