Questions tagged [autofac-configuration]
88 questions
0
votes
1 answer
Setting up AAD Authentication in a Project with Autofac
I have a web API that has AAD auth (in code because it runs in IaaS not PaaS) it works well, but if I add Autofac configuration to the Startup.cs, the Authentication breaks, (if I put Autofac after Auth inizialization Autofac breaks) which makes me…

Igal Flegmann
- 582
- 1
- 8
- 19
0
votes
1 answer
How to define default Autofac locale used when parsing json/xml configuration
I am trying to configure autofac using xml configuration but run into problems with locale. One of the component that I am trying to register needs double parameter which on my local system has format xxx,yyy - using comma as decimal separator. The…

Talapoin
- 13
- 5
0
votes
0 answers
Autofac Register Concrete Class
I am getting the below error on registering a concrete class using Autofac
This is the class
[AutomaticRetry(Attempts = 0)]
public class NoRetryJob where T : IRecurringJob
{
private T Job { get; set; }
private static readonly Logger…

Harsheet
- 728
- 9
- 23
0
votes
1 answer
Autofac & ASP.NET Core : why ASP.NET Core cannot reach ConfigureContainer method at Startup inheriting from StartupBase?
Description:
I am creating a ASP.NET Core application using Autofac, so I am following the documentation given for it: https://autofaccn.readthedocs.io/en/latest/integration/aspnetcore.html, should a be pretty straightforward path to follow, but I…

Diego Osornio
- 835
- 1
- 10
- 20
0
votes
1 answer
How to register decorator to be able to resolve decoree
I'm using Autofac.
I'm trying to register 2 classes with same interface using decorator pattern.
public interface IDoable
{
string Do();
}
public class Decoree : IDoable
{
public string Do()
{
return "decoree";
}
}
public…

Tomas
- 675
- 8
- 17
0
votes
1 answer
Is there way to know whether Controller is registerd with IAutofacAuthorizationFilter
We are building Authorization filter using Autofac's IAutofacAuthorizationFilter, we have register this filter in startup with our base controller. All controller inherit from our base controller. We have requirement in our execution to identify…

user145610
- 2,949
- 4
- 43
- 75
0
votes
1 answer
Autofac Module Implementation - Connection String
Intro: - I am new to programming and I have used constructor injection and the factory pattern a lot. This will be my first time using a third party tool, Autofac, for DI. I understand the basics but I'm looking for understanding on a few things…

Adam
- 3
- 2
0
votes
1 answer
Autofac Register closed types and retrieve them at run time
I have an Interface that will take in a generic type T
internal interface IQuestion where T : IWithOptionsId
{
Task Provide(Guid id);
}
Following by that I will implement this interface in multiple classes. For example
public class…

kkdeveloper7
- 497
- 2
- 11
- 25
0
votes
1 answer
Set default ConstructorSelector in Autofac
Autofac has a nice option to set the constructor resolve policy.
e.g. By using the MostParametersConstructorSelector:
builder.RegisterType()
.AsImplementedInterfaces()
.UsingConstructor(new…

Julian
- 33,915
- 22
- 119
- 174
0
votes
2 answers
autofac configuration in a json file inside bot framework
I am using a autofac json file which has all my dependencies listed. For reference below is the json file.
{
"defaultAssembly": "DigitalAssistant.Wharf",
"components": [
{
"type": "DigitalAssistant.Dialogs.RootDialog,…

Gaurav Tripathi
- 23
- 1
- 4
0
votes
2 answers
what is the difference between Autofac , Autofac.MVC ,Autofac.Integration.Mvc dlls
In my MVC web-app I get the following error thrown:
The request lifetime scope cannot be created because the HttpContext
is not available
When I google it I found a solution would be to upgrade my autofac.Mvc dll but I only use autofac dll,…

user3811011
- 1
- 2
0
votes
1 answer
Is it possible to set InstancePerRequest as default instance scope option for Autofac?
Autofac InstancePerDependency as the default if no other option is specified.
Is it possible to set InstancePerRequest as default instance scope option for Autofac?

user3132547
- 193
- 2
- 13
0
votes
1 answer
Resolve a class instance which takes parameters in constructor at run time using autofac
I'm following below example to create a class instance at runtime using autofac.
http://autofaccn.readthedocs.io/en/latest/advanced/delegate-factories.html
But when running locally, I'm seeing an exception. I'm very new to autofac and let me know if…

Hulk
- 97
- 3
- 16
0
votes
1 answer
Autofac scope configuration for multi-project solution
I have an ASP.NET web application which until now has been using an Autofac configuration class which has specified an InstancePerRequest() for services in the application.
Since then, I have created a new console application in the same solution…

Ciaran Gallagher
- 3,895
- 9
- 53
- 97
0
votes
1 answer
Read modules from web.config in autofac to change container configuration according to solution configurations
I have created some Autofac modules... Now I want to register some of them in my container using web.config... In my web.config I have written:
…

Simone
- 2,304
- 6
- 30
- 79