jeremydmiller on master
Deleting some old topic routing… Getting ready for Rabbit MQ bas… wip: set up the rabbit mq route… and 1 more (compare)
jeremydmiller on master
new simplified envelope routing… (compare)
Looking to use StructureMap in Azure Function to do multi tenancy. Found a sample that replaces the ServiceProvider in a Web Api (4 years old), wondering if that approach would work for Azure Functions.
Also is there a recent sample that works with .net core 3.1 Azure Functions?
.Inject()
to work like I think it should with SM 4.7, and I was wondering if anyone here could offer some insight. For some reason, it appears as though child.Inject
has no effect at all. I have a linqpad script here: https://gist.github.com/aggieben/a389b01b7ba637a265299c1b2f9337d0
public void TestSimpleDependency()
{
/*
Dependency hierarchy:
IFooRepository
=> IFoo
*/
var container = new Container(cfg =>
{
cfg.For<IFoo>().Singleton().Use<Foo>();
cfg.For<IFooRepository>().Singleton().Use<FooRepository>();
});
var child = container.CreateChildContainer();
var substituteFoo = Substitute.For<IFoo>();
child.Inject(substituteFoo);
var fooRepo = child.GetInstance<IFooRepository>();
fooRepo.Foo.Should().BeSameAs(substituteFoo); // fails assertion here
}
child.EjectAllInstances<IFooRepository>()
in the singleton case, and it still failed
And this kind of issue is a good example of why I wanted out of supporting SM:(
completely understand. I feel the same about the production code I'm trying to write tests for
Hi all,
guys, I have a periodical NullReferenceException when I'm trying to get instance using ObjectFactory.GetInstance<MyService>() but I cannot understand why this happens periodicaly but not permanent.
Could you help me please? Maybe this is a know issue? I use StructureMap 2.6.4.1, StructureMap.MVC4 2.6.4.3. Platform: .NET Framework 4.6.1
---> System.NullReferenceException: Object reference not set to an instance of an object.
at StructureMap.Pipeline.ObjectBuilder.ApplyInterception(Type pluginType, Object actualValue, BuildSession session, Instance instance) in c:\BuildAgent\work\767273992e840853\src\StructureMap\Pipeline\ObjectBuilder.cs:line 56
--- End of inner exception stack trace ---
at StructureMap.Pipeline.ObjectBuilder.ApplyInterception(Type pluginType, Object actualValue, BuildSession session, Instance instance) in c:\BuildAgent\work\767273992e840853\src\StructureMap\Pipeline\ObjectBuilder.cs:line 54
at StructureMap.Pipeline.ObjectBuilder.Resolve(Type pluginType, Instance instance, BuildSession session) in c:\BuildAgent\work\767273992e840853\src\StructureMap\Pipeline\ObjectBuilder.cs:line 27
at StructureMap.BuildSession.CreateInstance(Type pluginType, Instance instance) in c:\BuildAgent\work\767273992e840853\src\StructureMap\BuildSession.cs:line 176
at StructureMap.Container.GetInstance[T]() in c:\BuildAgent\work\767273992e840853\src\StructureMap\Container.cs:line 155
@Ruslan1213 Is there any way you can get on a more modern version of StructureMap?
Hi @jeremydmiller . Now there is no way to migrate to a new version as far as it contains breaking changes but we have quite complex project. Is there any woraround for this problem in our current version?
@alexanderbright You’d have to give a lot more information about your configuration to even start trying. I’d look at your actual interceptors first though
we work with @Ruslan1213 together for the same project. Which information you need except Ruslan mentioned above?