Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error - None of the constructors found with 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper'

Tags:

orchardcms

I have a custom module, Module1. In this module, I am referencing another custom module, Module2. Everything was working fine last week.

I did a fresh re-install of Orchard this morning. Since then, I have been getting this error.

None of the constructors found with 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Module1' can be invoked with the available services and parameters: Cannot resolve parameter 'Module2' of constructor 'Void .ctor(...)'.

Any idea how to fix this error?

Thanks.

like image 469
user471317 Avatar asked May 29 '12 23:05

user471317


4 Answers

That means that an implementation of some interface could not be found. Several thing can have happened: a module may have failed to compile, or you forgot to make an interface derive from IDependency.

like image 55
Bertrand Le Roy Avatar answered Nov 16 '22 16:11

Bertrand Le Roy


I know the post is quite old now, but just to link any possible mistake that could cause the described problem... here is my mistake.

I simply forgot to enable the referenced module from the dashboard. Of course that didn't prevent me to add a project reference and module dependency, having the code compiling perfectly .

The point is, my referenced module doesn't contain any content type definition. It is just a module conceived to collect some functionality and common utilities. That's why I forgot to enable it.

Cheers.

like image 23
edtruant Avatar answered Nov 16 '22 18:11

edtruant


You can get this error if you manually enabled your modules.

If so, fix it by deleting App_Data\cache.dat and then recycle the app pool.

like image 3
Keith Avatar answered Nov 16 '22 18:11

Keith


I had the same issue. It seems that I referenced the concrete class and not the interface in my constructor.

        public OrderService(
            IRepository<Order> orderRepository,
            ProductService productService,
            ProductCategoryService productCategoryService
        )

Instead of

        public OrderService(
            IRepository<Order> orderRepository,
            IProductService productService,
            IProductCategoryService productCategoryService
        )
like image 2
ysrb Avatar answered Nov 16 '22 16:11

ysrb