Questions tagged [autofac-module]

82 questions
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
0 answers

Multiple Containers alternative for Autofac

I have a package (it's name is Tree), Tree contains 10 internal services (interfaces) and they are resolved by Autofac. Tree contains 2 external services: TreeCommand TreeQuery I want to use multiple Trees in my…
Oguz Karadenizli
  • 3,449
  • 6
  • 38
  • 73
0
votes
0 answers

Implement plugin system using .Net Core Libraries with Autofac

A few months ago I built a very simply still effective plugin system with autofac modules in ASP.Net Core 1.1 like this In startup.cs public IServiceProvider ConfigureServices(IServiceCollection services) { var builder = new ContainerBuilder(); …
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
0
votes
0 answers

Autofac - Configure Module List-Property with object

I want to configure per XML a module with a property, which contains a list of class MyObject. My Module and MyObject class are looking like: public class MyModule : Module { public IList MyObjects { get; set; } protected override…
der_chirurg
  • 1,475
  • 2
  • 16
  • 26
0
votes
1 answer

Autofac - How to resolve instances registered using JSON Configuration

Our requirement is to have different Logger instances for different user defined threads. { "defaultAssembly": "Framework", "components": [ { "type": "SynapseMiddleware.Core.Framework.LoggerServicePerContext, Framework", "services": [ { …
0
votes
0 answers

Autofac registration - For user defined thread

In our project, we have multiple threads running in parallel. SO for each customer we have respective thread for them. Currently we have an application level logging, using Serilog, where logs for all the threads are written into one folder. We are…
0
votes
0 answers

Autofac - How to resolve a type registered in a module?

I have a problem using Autofac Module in my ASP.Net MVC Application. I use a NLogModule to "register" Nlog : public class NLogModule : Module { protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry,…
Mike
  • 13
  • 4
0
votes
2 answers

Could not load file or assembly 'Autofac, Version=3.0.0.0 after install of Autofac.WCF

I receive the exception, if i do the following steps: Test 1: MainApp-Project: Added Nuget Package Autofac Version 4.5.0 Added Nuget Package Autofac.WCF Version 4.0 Module-Project: Added Nuget Package Autofac.WCF Version 4.0 (Autofac 3.3.1 will…
Shazter
  • 305
  • 1
  • 4
  • 17
0
votes
0 answers

Call service layer from context

Firstly let me say that I might go down the wrong road with this but can't get my head around how to get this to work. What I'm trying to achieve is to call my service layer, to execute some functions, after I insert/update/delete database…
Høgsdal
  • 395
  • 4
  • 21
0
votes
1 answer

Skip unknown autofac modules configured in autofac.json

My application is initialized from autofac.json file: { "defaultAssembly": "Application", "modules": [ { "type": "Application.Plugin1.Module, Application.Plugin1" }, { "type": "Application.Plugin2.Module,…
Dumitru
  • 833
  • 3
  • 12
  • 26
0
votes
0 answers

Multiple log with different settings with log4net and autofac

I'm making a small web application by using ASP.Net Framework with log4net and Autofac 4.0 My application has to have multiple logging instance with different settings for each of them, i.e: FileLogger, DatabaseLogger, ... I'm using log4net module…
Redplane
  • 2,971
  • 4
  • 30
  • 59
0
votes
1 answer

Autofac load dependencies from referenced and non referenced assemblies

I have seen many question that ask how to load all referenced assemblies even if not directly used, but I would like to take that a step further. I am building a service and interface that can be extended, the intention is that I could extend the…
Neil Stevens
  • 3,534
  • 6
  • 42
  • 71
0
votes
1 answer

Nested list in dictionary property through Autofac.Configuration in JSON

I use Autofac.Configuration but I can't use nested property configuration. The following property NestedListInDictPropThatDoesNotWork is not working: "type": "Some.Modules.CoolModule, Some.Modules", "properties": { "StringProp":…
Beachwalker
  • 7,685
  • 6
  • 52
  • 94
0
votes
0 answers

How to Register a Type from an Autofac app.config file

In the building of my container, I would like to feed one of these lines via the configuration file //------------------------------------------------------------------------- //NOTE: Depending on the PerformanceCategoryDefine in Configuration…
codeputer
  • 1,987
  • 3
  • 19
  • 45