Questions tagged [structuremap4]

Version 4 of the StructureMap - Dependency Injection / Inversion of Control tool for .NET licensed under Apache 2.

Version 4 of the StructureMap - Dependency Injection / Inversion of Control tool for .NET licensed under Apache 2. It can be found at https://structuremap.github.io/

Related

56 questions
1
vote
1 answer

ASP.NET 5 Controller dependency injection of concrete class with no interface in to controller

Is it possible to use StructureMap to scan assemblies to be aware of concrete classes that do not implement interfaces? I am fairly new to StructureMap so not sure if this should be an obvious thing. For context, below are the highlights of the…
Bernd
  • 330
  • 1
  • 2
  • 7
1
vote
0 answers

Is there anyway to disable auto resolving concrete types in structuremap 4?

Just a simple question. I am looking for a way to disable the auto resolving concrete types feature (as described below): http://structuremap.github.io/resolving/requesting-a-concrete-type/ Is it possible ?
nikoniko
  • 833
  • 2
  • 11
  • 22
1
vote
0 answers

StructureMap 4.0.0 injecting concrete instance

I've recently updated structuremap and discovered that you can't inject concrete instances to properties anymore using old syntax. For example the code is no longer valid: public class IdentityRegistry : Registry { public IdentityRegistry() …
Dmytro
  • 16,668
  • 27
  • 80
  • 130
0
votes
0 answers

Get unique plug ins

I use structuremap as IOC container. I have three classes A, B and C. A has B and C as constructor dependencies, and B has C as constructor dependency. I illustrate it in the following figure: A ↗ ↖ …
Rico-E
  • 1,806
  • 2
  • 28
  • 47
0
votes
1 answer

Add structuremap registries into Microsoft.Azure.Functions.Extensions.DependencyInjection

I try to apply DI into Azure Function by reading this blog. The injected service in Azure Function belongs to another project which uses Structuremap for DI. My problem is that I can not add Structuremap registries into Azure Function Startup. Here…
ShrnPrmshr
  • 353
  • 2
  • 5
  • 17
0
votes
1 answer

What happens if StructureMap Registry has duplicate scan?

I'm trying to dig into a memory leak in my MVC web app and one thing i noticed is that my DefaultRegistry for StructureMap had a duplicated a scan...scan.TheCallingAssembly(): public DefaultRegistry() { Scan( scan => …
chadb
  • 199
  • 3
  • 12
0
votes
1 answer

Can't using StructureMap 4.5.2 in Asp.net MVC

I'm new to StructureMap and i'm using version 4.5.2. I registered my DataContext with StructureMap in Global.asax like this: void Application_Start(object sender, EventArgs e) { SetupIcoContainer(); // Code that runs on…
0
votes
0 answers

What is the difference between StructureMap.MVC5 and StructureMap 4.5.2 in Nuget Package Manager

In Nuget there are StructureMap.MVC5 and StructureMap(version 4.5.2). There is only version difference or something else?
0
votes
1 answer

show Method name expected when using StructureMap

i using StructureMap in my project for using DepencyInjection . I have 5 project in my solution. I have IUnitOfWork interface in DAL and I Defnation Function of IUnitOfWork in ApplicationDbContext . ApplicationDbContext : public class…
کیانوش
  • 3
  • 1
  • 5
0
votes
1 answer

IDisposable Singleton with StructureMap 4 & NestedContainer

I'm looking to register an EasyNetQ's IBus which implements IDisposable as a singleton with StructureMap. The issue is when using nested container, the instance is disposed with the container, thus leaving me with a singleton instance being disposed…
blemasle
  • 63
  • 1
  • 4
0
votes
1 answer

There is no implicit conversion from MapperConfiguration to IMapperConfiguration

I am using Automapper and StructureMap in my Web API application. I am getting the following error message during compilation. I have installed the following: StructureMap 4.5 StructureMap.MVC5 3.1.1.134 StructureMap.web…
Tom
  • 8,175
  • 41
  • 136
  • 267
0
votes
0 answers

Unable to inject Automapper and other layers using structuremap

I am implementing AutoMapper and structureMap in my WebAPI solution. I am unable to inject automapper using structuremap .I also want to inject my DAL,BAL and API layers. How do I do that with structure Map. I googled and thought I found a solution…
Tom
  • 8,175
  • 41
  • 136
  • 267
0
votes
1 answer

Register multiple instance based off of custom attribute with name list

I have a single rule that can handle multiple rule calls so I have created a custom attribute that is placed on the rule class. This attribute lists the names it is allowed to process. In structuremap I would like to register this same rule as…
DanoLoud
  • 24
  • 7
0
votes
0 answers

StructureMap find interface implementation in another namespace

I'm using StructureMap in an asp.net mvc 5 application, I have a lot of services, and for each service I have an interface and a class so for example I have an IUserService and a UserService, the interfaces are in a different namespace than the…
Lerner
  • 1,111
  • 13
  • 19
0
votes
0 answers

Structuremap V4.4.2 Create EntityFramework DbContext Per Request

I have an ASP.Net MVC application with Entity Framework. I have used Structuremap V4.4 as IoC Container tool. I want to make an instance of DbContext in each request. My configuration is as follows: var unique = new…