Giter Club home page Giter Club logo

Comments (8)

alexmg avatar alexmg commented on June 26, 2024

@wasabii Yes, making the module internal was intentional.

Do you have an exception that you can provide or a quick reproduction? I don't think RegisterAssemblyModules includes internal types by default.

from autofac.servicefabric.

alexmg avatar alexmg commented on June 26, 2024

It looks like internal types are considered. I guess what makes this different from regular cases is the non-default constructor. This is actually an issue for the core library more than this integration. I might open a separate issue in core for this.

from autofac.servicefabric.

tillig avatar tillig commented on June 26, 2024

Be careful if you change this in the core - had a similar issue about assembly type scanning and people have come to rely on the behavior, considering it a breaking change when I tried to make it public-only by default.

from autofac.servicefabric.

alexmg avatar alexmg commented on June 26, 2024

I was just about to link that that very issue. 😄

from autofac.servicefabric.

alexmg avatar alexmg commented on June 26, 2024

It is actually the internal constructor that is causing the problem in this case. The internal class is located in RegisterAssemblyTypes but the instance cannot be created because the DefaultConstructorFinder excludes the internal constructor.

From a backwards compatibility perspective changing anything in core around this will be difficult, especially since it sits on top of something that we have already decided is hard to change. A similar "public only" option is something that could be considered.

I would certainly recommend when assembly scanning to try and reduce what you include. Using a base type for your modules is a reasonable choice. I'll have a think about what else we might be able to do.

from autofac.servicefabric.

tillig avatar tillig commented on June 26, 2024

Internal type, public constructor?

from autofac.servicefabric.

alexmg avatar alexmg commented on June 26, 2024

That does prevent the exception but still includes the module in the scan. I actually added code in the RegisterServiceFabricSupport method to prevent the registrations in the module from being added twice. It might not matter that much, but it does highlight an issue with overreach in the module registration path.

from autofac.servicefabric.

alexmg avatar alexmg commented on June 26, 2024

I think I'll just convert the module code into a static helper method removing the module from the picture all together.

from autofac.servicefabric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.