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

Injecting Session with StructureMap in ASP .Net MVC

I am trying to inject ASP .Net MVC Session into a Controller by providing in interface for it using StructureMap. But StructureMap complaints while trying to do this as HttpContext.Current is not initialized at the time of registry initialization. I…
0
votes
2 answers

From StructureMap to Unity

I've been looking for an answer but couldn't find one. I have a project which uses StructureMap as it's dependency container but now I want to try Microsoft's unity. However, I couldn't find how to convert this piece of code to…
Tequilalime
  • 611
  • 9
  • 29
0
votes
2 answers

Picking Up Repositories With Structuremap

I am not sure how to use StructureMap to scan for all repositories in a particular namespace. Most repositories take the form: namespace CPOP.Infrastructure.Repositories { public class PatientRepository : LinqRepository,…
alphadogg
  • 12,762
  • 9
  • 54
  • 88
0
votes
1 answer

Specifying a separate injection for a particular interface

Suppose I have the following hierarchy which I wish to instantiate with DI: DatabaseService(IDatabaseRepository) : IDatabaseService Database1Service(IDatabaseRepository) : IDatabase1Service Database2Service(IDatabaseRepository) :…
Arithmomaniac
  • 4,604
  • 3
  • 38
  • 58
0
votes
1 answer

Set a StructureMap Nested Container to resolve unique object instances by default

According to StructureMap's documentation the default behavior of containers is that a Parent Container resolves a new object instance each time one is requested and Nested Containers resolve the same object instance. In 99% of cases this is fine -…
0
votes
1 answer

Getting Reference to StructureMap Container

I'm new to StructureMap and have a scenario where I would like to get a handle to the container. I am building a Web API service initializing StructureMap container in Application_Start of Global.asax IContainer container =…
Jay
  • 177
  • 2
  • 12
0
votes
2 answers

ServiceLocatorImplBase.cs not found

When my WebAPI controller is called from a client, I run into the following errors: ServiceLocatorImplBase.cs not found error An exception of type 'Microsoft.Practices.ServiceLocation.ActivationException' occurred in…
user266909
  • 1,841
  • 3
  • 32
  • 58
0
votes
1 answer

StructureMap.IContext.RequestedName?

1)IStudyService studyService3 = ServiceLocator.Current.GetInstance(); What would be the StructureMap.IContext.RequestedName in the above call , when we go with empty key? Will it be null or wmpty? Key Note: IStudyService studyService2 =…
0
votes
1 answer

Registering types with StructureMap via Scan method

I have IService interface and many IService implementations in other assembly. I need to register all implementations as service for types that are in inheritance chain between IService and concrete IService implementation. For example: public…
AlbertK
  • 11,841
  • 5
  • 40
  • 36
0
votes
1 answer

How i can inject context from UnitOfWork using StructureMap

Hi i have mi project in MVC5, i am using Identity 2.0, commonRepository and Structuremap to inject dependencies, the problem is when I am in the controller AccountController, i have one Contex and when my UnitOfWork inject the repositories it create…
0
votes
2 answers

How do I update to StructureMap 3.x while staying on NServiceBus 4.x?

I want to upgrade to StructureMap 3.x on my MVC project, but I'm stuck on NServiceBus 4.x because the 5.x license terms do not make sense for our limited usage. The MVC project is send-only. How can I upgrade StructureMap while leaving NSB 4.x in…
Josh Kodroff
  • 27,301
  • 27
  • 95
  • 148
0
votes
1 answer

IServiceLocator.GetInstance() is not working

We have an extension method to register the service as shown below we are saying return me the out of proc instance only if the key is remote host name. in detail we expected to receive in proc instance for all three calls mentioned…
0
votes
2 answers

New To StructureMap - Getting No Default Instance Error 202

I am very new to StructureMap and am getting the following error: StructureMap Exception Code: 202 No Default Instance defined for PluginFamily Company.ProjectCore.Core.IUserSession, Company.ProjectCore, Version=1.0.0.0, Culture=neutral,…
Peter
  • 5,251
  • 16
  • 63
  • 98
0
votes
1 answer

Conditional and delayed registration on StructureMap

I am registering OwinContext in StructureMap: container.Register(() => HttpContext.Current.GetOwinContext()); But I get the following error on AssertConfigurationIsValid: No owin.Environment item was found in the context I found a solution for…
Miguel Moura
  • 36,732
  • 85
  • 259
  • 481
0
votes
2 answers

NHibernate does not update entity when repository is passed by constructor

I am developing with NHibernate for the first time in conjunction with ASP.NET MVC and StructureMap. The CodeCampServer serves as a great example for me. I really like the different concepts which were implemented there and I can learn a lot from…
1 2 3
99
100