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?
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 can't recall any callsite which might involve persistance of the client resource providers to the database.. You sure that this is not some weird cache / rebuild issue?
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?