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

1 2 >
Posted: August 09, 2018 at 3:45 PM Quote #210349
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
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: August 10, 2018 at 2:41 AM Quote #210361
One of your class cannot be instantiated by Autofac, did you have your custom class, and forgot to register in dependency registrar?


This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Lam Woon Cherk
https://www.pronopcommerce.com

Sign up to my mailing list for tons of tips on nopCommerce: http://bit.ly/2fg5fMy

HINT: Upon signing up, you'll receive my e-book "nopCommerce Speed Optimization" on
how to make your nopCommerce websites score A in Google PageSpeed Insights
Posted: August 10, 2018 at 6:53 AM Quote #210374
I'll Check if i did it and if not, how to do it...
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: August 10, 2018 at 7:47 AM Quote #210376
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
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: August 10, 2018 at 11:32 AM Quote #210388
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?
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Please up-vote the answer, if it helpful to you! :)

Cheers,
sk5202
Posted: August 10, 2018 at 11:40 AM Quote #210390
No, i just followed the tutorial to create a plugin, my controller has only the Configure Method that calls the Configure.cshtml View....
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: August 10, 2018 at 11:53 AM Quote #210392
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...
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: August 10, 2018 at 12:19 PM Quote #210394
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.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Please up-vote the answer, if it helpful to you! :)

Cheers,
sk5202
Posted: August 11, 2018 at 7:43 AM Quote #210415
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 :)
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
www.noptools.com
Posted: August 13, 2018 at 6:45 AM Quote #210472
The error occurs always when i click on "install" on my plugin....
i've deleted all the classes, but the error still occurring.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
1 2 >
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.
eCommerce CONFERENCE 2018
Learn more