Questions tagged [structuremap]

StructureMap is a Dependency Injection / Inversion of Control tool for .NET licensed under Apache 2.

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

Installation

StructureMap can most easily be installed through its NuGet package.

Install-Package structuremap

Links

Related

1728 questions
0
votes
1 answer

Trouble Referencing StructureMap.AutoMocking.dll to use RhinoAutoMocker

I've been dying to try out StructureMap's auto mocking container for RhinoMocks per: http://docs.structuremap.net/AutoMocker.htm This documentation states: Out of the box, StructureMap includes the RhinoAutoMocker for RhinoMocks and…
jakejgordon
  • 4,008
  • 7
  • 36
  • 45
0
votes
2 answers

StructureMap: Wiring (generic) implementations to an implementation of another type

If I have an interface: public interface IRepository And an abstract class: public abstract class LinqToSqlRepository : IRepository where T : class where TContext : DataContext And a whole bunch of…
Jeremy Frey
  • 2,334
  • 2
  • 22
  • 26
0
votes
1 answer

Structuremap in MVC5

I'm using structuremap 3.1.2.138 in MVC5. In my IoC-class i'm trying to use the Objectfactory but it states Objectfactory is obsolete and I should use Container but I can't find a way to make this work. public static IContainer Initialize() { …
0
votes
1 answer

How can I use from Structuremap auto register in asp.net-mvc?

I have a simple mvc application that has 3 layer Ui => has refrence to Common And Services Common Services => has refrence to Common I define my Service Contracts in Common layer and implement it in services layer //Common layer public interface…
M.Azad
  • 3,673
  • 8
  • 47
  • 77
0
votes
3 answers

Using StructureMap, when a default concrete type is defined in one registry, can it be redefined in another registry?

In the project I'm working on I have a StructureMap registry for the main web project and another registry for my integration tests. During some of the tests I wire up the web project's registry, so that I can get objects out of the container for…
Mark Rogers
  • 96,497
  • 18
  • 85
  • 138
0
votes
1 answer

ASP.NET MembershipProvider and StructureMap

I was using the default AspNetSqlMembershipProvider in my application. Authentication is performed via an AuthenticationService (since I'm also supporting other forms of membership like OpenID). My AuthenticationService takes a MembershipProvider as…
Ben Foster
  • 34,340
  • 40
  • 176
  • 285
0
votes
2 answers

Converting From Castle Windsor To StructureMap In An MVC2 Project

I am learning about best practices in MVC2 and I am knocking off a copy of the "Who Can Help Me" project (http://whocanhelpme.codeplex.com/) off Codeplex. In it, they use Castle Windsor for their DI container. One "learning" task I am trying to do…
alphadogg
  • 12,762
  • 9
  • 54
  • 88
0
votes
1 answer

In structuremap, how do I scan assemblies and add all registrations as singletons?

I wish for structuremap to scan my assemblies and register classes as singletons. I'd further restrict this to factories, services etc. For now, however, the challenge is to mark the found registrations as singletons. I've found out that one way is…
Anders Juul
  • 2,407
  • 3
  • 34
  • 56
0
votes
1 answer

StructureMap IoC problem getting the instance in runtime

i have 2 concrete types "CategoryFilter" & "StopWordsFilter" that implements "IWordTokensFilter". Below is my setup: ForRequestedType().TheDefaultIsConcreteType() .AddInstances(x => { …
Petrick Lim
  • 91
  • 1
  • 7
0
votes
2 answers

.NET - create instance of each type that implements specific interface

I have interface IModule and several classes that implements it. In test i need to create instance of each type(class) implementing that interface. Is is possible(with StructureMap)?
Feryt
  • 2,262
  • 2
  • 22
  • 32
0
votes
0 answers

Structuremap type mapping

I currently have: var container = new Container(x => { x.For().Use().Singleton(); } This replaces all instances of new IService() with new Service(); I also have: var T = typeof(IService); How do I inject Service there?
MichaelAttard
  • 1,898
  • 2
  • 17
  • 26
0
votes
3 answers

Passing an object to constructor when using StructureMap 3

I have some UserControls in my c# project and use Structuremap 3 as my IoC container, when I want to access the UserControls I use following code: var uc = new UserControlFactory().Create(); .... and this is UserControlFactory…
Masoud
  • 8,020
  • 12
  • 62
  • 123
0
votes
1 answer

StructureMap problems with bidirectional/circular dependencies

I am currently integrating StructureMap within our business layer but have problems because of bidirectional dependencies. The layer contains multiple managers where each manager can call methods on each other: there are no restrictions or rules for…
leozilla
  • 1
  • 1
  • 1
0
votes
1 answer

Using StructureMap 3 in multiple ASP MVC projects

First lets start to describe my project architecture. I have a asp.net mvc application called Portal.Web as startup project and multiple asp.net mvc applications which called Plugin.XXX (Plugin.News, Plugin.Cms, etc) and Portal.Web has references…
0
votes
2 answers

No default instance or named instance 'Default' for requested plugin type

I'm trying to avoid referencing the concrete type library in my main project, but I'm getting this error: No default instance or named instance 'Default' for requested plugin type StackExchangeChatInterfaces.IClient 1.)…
ton.yeung
  • 4,793
  • 6
  • 41
  • 72
1 2 3
99
100