Prerequisites
What is your product version? -> 8.1 What is your product type (Angular or MVC)? -> Angular What is product framework type (.net framework or .net core)? -> .net core
Hello,
I need to use the same class (IIdeasMessageRepository) in two different modules.
The above image shows where IIdeasMessageRepository is originally registered for dependency injection.
But, I also need to use IIdeasMessageRepository in this project.
When I don't register the dependency in this module I get this exception.
Once I register the depedency.
I get this exception instead and sometimes I get the duplicate registration error.
How can I use/register the same class in two different modules without getting an exception?
5 Answer(s)
-
0
hi
I think you should depend on the
IdeasMessageingModule
instead of registering its service(IIdeasMessageRepository
).Can you share the structure of your project and modules?
-
0
-
0
hi @MellowoodMedical
Could you share a simple project that reproduce the problem with me? [email protected]
-
0
Unfortunately I do not have a sample project that can reproduce the issue.
I will attempt to recreate it and it may take some time.
-
0
Hi @MellowoodMedical
Thanks, we are waiting for your reproduction project.