Mistake. None of the constructors found using "Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper"

I have my own module Module1. In this module, I refer to another custom module Module2. Last week, everything worked perfectly.

This morning I did a new reinstall of Orchard. Since then I get this error.

None of the constructors found using "Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper" in type "Module1" can be called by available services and parameters: it is impossible to enable the parameter "Module2" of the constructor "Void.ctor" (... )

Any idea how to fix this error?

Thanks.

+7
source share
5 answers

This means that the implementation of any interface cannot be found. Perhaps several things happened: the module may not have been able to compile, or you forgot to make the interface out of dependency.

+4
source

I know that the message is already quite old, but just link any possible error that might cause the described problem ... here is my error.

I just forgot to enable the link module from the control panel. Of course, this did not stop me from adding a link to the project and a dependency on the module, with full compilation of the code.

The fact is that my link module does not contain a content type definition. This is just a module designed to collect some functions and common utilities. That is why I forgot to turn it on.

Greetings.

+3
source

I had the same problem. It seems that I was referring to a specific class, not an interface in my constructor.

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

Instead

  public OrderService( IRepository<Order> orderRepository, IProductService productService, IProductCategoryService productCategoryService ) 
+2
source

You can get this error if you manually enabled your modules. Make sure you uninstall App_Data \ cache.dat and recycle the application pool.

+1
source

:

  • The interface is based on IDependency
  • The implementation comes from the interface
  • The constructor refers to the interface
  • Build everything and see if all the link modules compile
  • Enable module in admin panel

Example:

 public class myController : Controller{ private readonly IMyService _myService; public myController( IMyService myService ) { _myService = myService; } } 
 public interface IMyService : IDependency { int GetOne(); } 
 public class MyService: IMyService { public MyService() { // init code } public int GetOne() { return 1; } } 
0
source

All Articles