Share via


Need help on error: The current type, is an interface and cannot be constructed

Question

Thursday, September 19, 2013 7:01 AM

Hi,

I am getting below error

Server Error in '/FrameworkServices' Application.
________________________________________
The current type, Mustang.Interception.IInterceptionProvider, is an interface and cannot be constructed. Are you missing a type mapping?
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The current type, Mustang.Interception.IInterceptionProvider, is an interface and cannot be constructed. Are you missing a type mapping?

Error occured at this code

 IInterceptionProvider interceptionProvider = dependencyResolver.Resolve(typeof(IInterceptionProvider)) as IInterceptionProvider;

All replies (2)

Thursday, September 19, 2013 8:22 AM ✅Answered

You need to specify what object the interface should resolve. Depending on the DI you need to register the object for a type. Check this link.

http://eikden.net/2011/02/28/problem-with-unity-is-an-interface-and-cannot-be-constructed-are-you-missing-a-type-mapping/


Thursday, September 19, 2013 8:30 AM ✅Answered

Check out this answer 

http://stackoverflow.com/questions/14549156/exception-is-invalidoperationexception-the-current-type-is-an-interface-and