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

How to configure referenced assemblies? #87

Open
TiangangLv opened this issue Nov 16, 2019 · 2 comments
Open

How to configure referenced assemblies? #87

TiangangLv opened this issue Nov 16, 2019 · 2 comments

Comments

@TiangangLv
Copy link

TiangangLv commented Nov 16, 2019

I created a class library project, in which there is an abstract class
"ScreenViewModelBase",
I created another class library project, and established
"ShellViewModel: ScreenViewModelBase"
When I refer to these two class libraries in the main project, I create
"public class AppBootstrapper: Bootstrapper"
with exception "no registrations found for service ShellViewModel." so when I rewrite "ConfigureIoC", I add builder. Bind<Screenviewmodelbase>(). Toallimplementation(), the same exception will still occur, but when I no longer have cited After all the code is implemented to the main project in this way, this exception will not happen again. It seems that everything is normal again. I don't understand why? Is it related to the assembly?

@canton7
Copy link
Owner

canton7 commented Nov 16, 2019

In your ConfigureIoC method, you need to add the assemblies to builder.Assemblies.

So:

builder.Assemblies.Add(typeof(ShellViewModel).Assembly); 

@TiangangLv
Copy link
Author

Thank you so much.

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