Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 15 02:42
    natalie-perret-1986 commented #1283
  • Jun 14 16:03
    dariogriffo edited #1843
  • Jun 14 08:18
    dnfadmin commented #1843
  • Jun 14 08:17
    dnfadmin commented #1843
  • Jun 14 08:17
    dariogriffo opened #1843
  • Jun 09 11:26
    VilleHakli edited #1842
  • Jun 09 07:55
    VilleHakli opened #1842
  • Jun 08 04:54

    mysticmind on master

    Bump up version to rc.2 (compare)

  • Jun 04 21:25

    jeremydmiller on master

    deleted some tests that are dup… (compare)

  • Jun 04 20:58
    jeremydmiller commented #1840
  • Jun 04 20:57
    jeremydmiller closed #1840
  • Jun 04 20:57

    jeremydmiller on master

    Add multi-tenancy failure scena… fixed the default filters for L… (compare)

  • Jun 04 20:17
    jeremydmiller commented #1840
  • Jun 04 15:25
    CodingGorilla labeled #672
  • Jun 04 15:25
    CodingGorilla opened #672
  • Jun 04 09:51
    flick556 edited #1841
  • Jun 04 09:51
    flick556 opened #1841
  • Jun 04 07:55
    Hawxy synchronize #1840
  • Jun 04 07:41
    Hawxy opened #1840
  • Jun 03 13:04

    mysticmind on master

    Update GH NuGet publish with --… (compare)

Ben Collins
@aggieben
I'm still playing around with examples, but here's a pretty good simple repro:
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
}
Jeremy D. Miller
@jeremydmiller
I’d guess that the bug is due to the foo repository being a singleton. YOu might try it ContainerScoped() instead
Ben Collins
@aggieben
hmm. if I configure IFooRepository repository like this: cfg.For<IFooRepository>().ConatinerScoped().Use<FooRepository>(), then the test works
I also tested it with child.EjectAllInstances<IFooRepository>() in the singleton case, and it still failed
my problem here is that I'm going to be stuck with using singletons; that's not something I can change in the real code :-(
Jeremy D. Miller
@jeremydmiller
And this is also the time when I remind you that StructureMap is no longer supported and I’m encouraging folks to move to Lamar
And this kind of issue is a good example of why I wanted out of supporting SM:(
Ben Collins
@aggieben
yeah. I wish I could, but I'm also stuck on that count as well, at least for the time being

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

Ben Collins
@aggieben
@jeremydmiller thanks for the tip on ContainerScoped. That might actually be good enough to get me out of my predicament
Piyush Gupta
@creativepiyush_twitter
On upgrading to .net framework 4.8, structure map started to fail
StructureMap.StructureMapConfigurationException: No default Instance is registered and cannot be automatically determined for type 'PartStream.Core.Services.IPartService'
Works on local but giving error on server
any pointers?
Jeremy D. Miller
@jeremydmiller
Always start with the WhatDoIHave() diagnostics. If you’ve got type scanning happening, look at the type scanning diagnostics. It’s not unlikely that you’ve got a dependency problem that keeps type scanning from being able to look through an assembly.
Jacek Kowalski
@kicaj29
hi, maybe somebody could take a look on my issue reported here https://stackoverflow.com/questions/66528541/structuremap-does-not-see-types-in-asp-net-core-net5
Ruslan1213
@Ruslan1213

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

Jeremy D. Miller
@jeremydmiller
@Ruslan1213 Is there any way you can get on a more modern version of StructureMap?
Ruslan1213
@Ruslan1213
@jeremydmiller , No, unfortunately I can not raise the version because there are many dependencies:(
Jeremy D. Miller
@jeremydmiller
Because strong typing, or diamond dependencies, or both? And I’m sorry.
alexanderbright
@alexanderbright

@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?

Jeremy D. Miller
@jeremydmiller
@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
alexanderbright
@alexanderbright

@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?

Jeremy D. Miller
@jeremydmiller
The registration for what’s being built in the first place, and also how you’ve configured the activator. My guess is that you’re doing something that’s returning a null inside of your own lambdas supplied to StructureMap
And also, you do know that StructureMap is no longer supported, right?