Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
I guess I could probably rename the (controller) type after removing the interface to avoid the casting error, but I would still like to know the root cause of the problem. :)
I had a block controller which implemented the
IClientResourceRegistrator
interface. After removing the interface from the controller class, Episerver breaks on restart with an exception like:Specified argument was out of the range of valid values.
Parameter name: instance 'MyControllerType' with ReturnType MyControllerType cannot be cast to EPiServer.Framework.Web.Resources.IClientResourceRegistrator
The exception stems from StructureMap, and I'm guessing it's because something has been persisted to the database.
Any ideas on how to solve this without having to keep the interface implementation with an empty
RegisterResources
method?