ninject / Ninject.Extensions.Interception

Interception extension for Ninject
Other
58 stars 27 forks source link

Assembly binding issue within dynamic proxy #33

Closed subhrajitroy closed 9 years ago

subhrajitroy commented 9 years ago

I have the following DLL dependencies. Main.dll uses Contract.dll version 1.0.0.1 Main.dll also uses Client.dll , Client.dll uses contract.dll version 1.0.0.0

Main.dll uses windsor container to get a service defined in Client.dll (interceptors registered to container for logging) and invoked a method on it, passing a parameter, the type of which is defined in Contract.dll.

//Message.class in Contract.dll var message = new Message("some context dependent text")

//IService defined in Client.dll

var service = container.Get(); service.DoSomething(message)

I get this error

Could not load file or assembly 'Contract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required.

The dll available during runtime is version 1.0.0.1 and none of the dll(s) involved are strongly named so the usual case of a signed assembly using an unsigned assembly can be ruled out.

But I will assume as the public interfaces are identical, this should have worked.

The version of castlle.core and windsor used is 2.5.1 and I am currently unable to move to newer versions in the near future.

subhrajitroy commented 9 years ago

The reason I think its a dynamic proxy is issue, is because if I understand correct , dyamic proxies will come into picture if interceptors are registered as in this case. Everything works fine if I do not register the interceptor.

scott-xu commented 9 years ago

This is Ninject forum but not Windsor