One of application has below design:
Presentation layer: 1) MVC 4 (contains reference to WCF service) and using ninject DI for controller constructor inject - where interface and implementation are both on same project - MVC.
BAL and DAL 2) WCF Service
Converted to below design:
1) MVC (no service reference and removed ninject and only contains interfaces which are injecting into controller) 2) New library project (contain reference of MVC project and implementation of interfaces which are existed into MVC application) and added ninject module for DI.
3) WCF service
Problem: When I execute the first design approach then, it works fine and I found, controller injected interface instance but, when I have make loosely couple for WCF service reference and added into new separate project and move each interfaces into that separate project then, on execution of MVC application, it gives me below error:
System.MissingMethodException: No parameterless constructor defined for this object.
this looks like issue due to ninject DI.
NOTE: In MVC, project, there is no NinjectWebCommon
and ServiceModule
both are moved into that newly added class library project. Interfaces which are injecting into controller are existed into MVC project and its implementation existed int newly added class library project.
Please suggest me what is wrong here.
thank You