Please submit a failing test case. Otherwise we'd be guessing.

On 20/01/2011 9:32 PM, Lundberg, Per wrote:

Hello,

We are using the Typed Factory facility in our application framework, to provide an easy way to be able to instantiate transient components (view models and entities, in our case).

This has worked well for some time now. However, recently, a very weird issue has popped up: in one of our project (not all of them), the factory that we are using is throwing an exception whose message looks like this:

GenericArguments[0], 'T', on 'Castle.Proxies.Invocations.IEntityFactory_CreateEntity[T]' violates the constraint of type parameter 'T'.

The source of the exception is the DynamicProxyGenAssembly2. The class causing the exception is Castle.Proxies.IEntityFactoryProxy.CreateEntity[T]() – our factory interface is IEntityFactory, and the relevant method is defined like this:

        T CreateEntity<T>() where T : EntityBase;

The strange is that the T type that we are passing in to the method clearly derives from EntityBase (obviously in a correct manner, because otherwise the compiler would yell at us…)

Any suggestions/ideas? As mentioned above, we are still on Castle Windsor 2.5.1.

Best regards,

Per Lundberg

--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Castle 
Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to