I have a hosted MVC 4 application with MEF system in it. Everytime the system tries to create the controller that is injected by the MEF, this error occurs:
The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) Specified argument was out of the range of valid values. Parameter name: site
Resulting in: An exception occurred while trying to create an instance of type 'EAccountingControllers.EAccountingController'.
Resulting in: Cannot activate part 'EAccountingControllers.EAccountingController'. Element: EAccountingControllers.EAccountingController --> EAccountingControllers.EAccountingController --> AssemblyCatalog (Assembly="EAccounting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
Resulting in: Cannot get export 'EAccountingControllers.EAccountingController (ContractName="EAccounting")' from part 'EAccountingControllers.EAccountingController'. Element: EAccountingControllers.EAccountingController (ContractName="EAccounting") --> EAccountingControllers.EAccountingController --> AssemblyCatalog (Assembly="EAccounting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
It is fine If I hosted on my local IIS, but it produces error when I hosted on external hosting provider.
What is causing this error?