I have an application that was working fine that uses Windsor for IoC. I want to log the method calls, parameters, and execution time of all calls made to components instantiated by Windsor, so I implemented a LoggingInterceptor that implements IInterceptor, that contains:
Stopwatch sw = new System.Diagnostics.Stopwatch();
sw.Start();
invocation.Proceed(); // EXCEPTION IS THROWN HERE
sw.Stop();
Logger.Debug(.....
Now operations that previously worked fine are throwing VerificationExceptions with the following message:
Method Repositories.RepositoryBase.GetAll: type argument 'ET' violates the constraint of type parameter 'ET'.
The signature of the method is:
public IList<ET> GetAll<ET>() where ET : EntityBase2, IEntity2
(where EntityBase2 and IEntity2 are from LLBLGenPro)
The caller of the method is as follows:
public IList<ServerEntity> GetServers()
{
return GetRepository<IServerRepository>().GetAll<ServerEntity>();
}
(where GetRepository<>() is just a wrapper around ServiceLocator)
If I comment out the interceptor from the castle configuration, it all works fine again.
Why is this happening now, and is there a fix so I can use my logging interceptor?
thanks