Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register ICarterModule From Other Assembly #361

Open
mohammaddarweesh opened this issue Aug 24, 2024 · 1 comment
Open

Register ICarterModule From Other Assembly #361

mohammaddarweesh opened this issue Aug 24, 2024 · 1 comment

Comments

@mohammaddarweesh
Copy link

Kindly, can you add register ICarterModule from all assemblies of the solution

@mohammaddarweesh mohammaddarweesh changed the title Register Service From Assembly Register ICarterModule From Other Assembly Aug 24, 2024
@ArcadeArchie
Copy link

ArcadeArchie commented Feb 19, 2025

doesnt the Assembly catalog already provide a way to do this?
Optional DependencyContextAssemblyCatalog containing assemblies to add to the services collection. If not provided, the default catalog of assemblies is added, which includes Assembly.GetEntryAssembly.
so something like this should do the trick.

        var assembly = typeof(Program).Assembly;

        builder.Services.AddCarter(new DependencyContextAssemblyCatalog([assembly]));
       //or builder.Services.AddCarter(new DependencyContextAssemblyCatalog(assembly1, assembly2, assembly3));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants