Error No constructor was found that had all the dependencies satisfied.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 лет назад
Im following this tutorial to create a basic plugin, http://docs.nopcommerce.com/pages/viewpage.action?pageId=40304642

I see my plugin on plugins list, but when i install it, it gives me the Exception:

"No constructor was found that had all the dependencies satisfied."

Im new in NopCommerce development, and i've searched about this error, but nothing seems to be related to what im using.
I have a Controller, with a Configure method, a constructor, a Model and a View.

Thanks for your attention
5 лет назад
One of your class cannot be instantiated by Autofac, did you have your custom class, and forgot to register in dependency registrar?


5 лет назад
I'll Check if i did it and if not, how to do it...
5 лет назад
I saw how to add a Dependency Registrar class, but on the video it says only how to register classes of Service or Data Access.. I don't have such classes, just the View, Controller and Model
5 лет назад
wooncherk wrote:
One of your class cannot be instantiated by Autofac, did you have your custom class, and forgot to register in dependency registrar?


.


hello,

Yes wooncherk is right. i am also facing same issue few days ago.

After i found that one third party dll occur this issue.


lucasipag wrote:
I saw how to add a Dependency Registrar class, but on the video it says only how to register classes of Service or Data Access.. I don't have such classes, just the View, Controller and Model


are you using any third party dll?
5 лет назад
No, i just followed the tutorial to create a plugin, my controller has only the Configure Method that calls the Configure.cshtml View....
5 лет назад
I added a DependencyRegistrar class loading my controllers and models
the error changed to "Object reference not set to an instance of an object"
Then, I removed the class, cleaned the project and builded it again, but this error now persists...
5 лет назад
Hello lucasipag,

If you create any new service in plugin than you should add this service to dependency register otherwise not.

best way to follow this document for later version such as 4.0 and 4.1

https://github.com/nopSolutions/nopCommerce/releases/download/release-4.00/nopCommerce_4.00_upgrade_guide.pdf

For earlier version you should follow this document.

https://dzone.com/articles/beginners-guide-to-nopcommerce-plugin-development.
5 лет назад
lucasipag wrote:
I added a DependencyRegistrar class loading my controllers and models
the error changed to "Object reference not set to an instance of an object"
Then, I removed the class, cleaned the project and builded it again, but this error now persists...

So where is the error occurring? I.e. what does the stack trace say?  Set a breakpoint there and debug it :)
5 лет назад
The error occurs always when i click on "install" on my plugin....
i've deleted all the classes, but the error still occurring.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.