davybrion / Agatha

Agatha Request-Response Service Layer for .NET
http://davybrion.github.com/Agatha/
Other
86 stars 39 forks source link

Agatha and Ninject 3.0 #23

Closed michaelaird closed 12 years ago

michaelaird commented 12 years ago

It looks like Ninject 3.0 has removed a method that the Agatha Ninject container relies on. When i try to run it, i get the following error:

[MissingMethodException: Method not found: 'Ninject.Syntax.IBindingToSyntax`1 Ninject.Syntax.IBindingRoot.Bind(System.Type)'.] Agatha.Ninject.Container.Register(Type componentType, Type implementationType, Lifestyle lifeStyle) in c:\src\agatha\Agatha.Ninject\Container.cs:23 Agatha.ServiceLayer.ServiceLayerConfiguration.RegisterRequestHandlerInterceptor() in c:\src\agatha\Agatha.ServiceLayer\ServiceLayerConfiguration.cs:190 Agatha.ServiceLayer.ServiceLayerAndClientConfiguration.RegisterRequestHandlerInterceptor() in c:\src\agatha\Agatha.ServiceLayer\ServiceLayerAndClientConfiguration.cs:108

Is there a work-around for this? or a planned update to support Ninject 3.0?

Thanks, Michael.

michaelaird commented 12 years ago

Also, it might be a good idea to republish the nuget packages with a version range to prevent people from updating ninject unknowingly.

davybrion commented 12 years ago

haven't really planned an update to NInject 3.0 yet... If you need it urgently, I'd welcome a pull request :)

On Tue, Apr 24, 2012 at 9:56 PM, Michael Aird < reply@reply.github.com

wrote:

It looks like Ninject 3.0 has removed a method that the Agatha Ninject container relies on. When i try to run it, i get the following error:

[MissingMethodException: Method not found: 'Ninject.Syntax.IBindingToSyntax`1 Ninject.Syntax.IBindingRoot.Bind(System.Type)'.] Agatha.Ninject.Container.Register(Type componentType, Type implementationType, Lifestyle lifeStyle) in c:\src\agatha\Agatha.Ninject\Container.cs:23

Agatha.ServiceLayer.ServiceLayerConfiguration.RegisterRequestHandlerInterceptor() in c:\src\agatha\Agatha.ServiceLayer\ServiceLayerConfiguration.cs:190

Agatha.ServiceLayer.ServiceLayerAndClientConfiguration.RegisterRequestHandlerInterceptor() in c:\src\agatha\Agatha.ServiceLayer\ServiceLayerAndClientConfiguration.cs:108

Is there a work-around for this? or a planned update to support Ninject 3.0?

Thanks, Michael.


Reply to this email directly or view it on GitHub: https://github.com/davybrion/Agatha/issues/23

michaelaird commented 12 years ago

Gotcha. I'll see if i can pull something together this week and submit a pull request.

bartdeleye commented 12 years ago

Upgraded nuget package to Ninject 3.0.0.15 All configuration tests succeed. Which versions of Agatha/Ninject are you using?

michaelaird commented 12 years ago

I'm using v1.3 from Nuget.

When I look at it in JustDecompile, the method looks like this:

public ServiceLayerConfiguration RegisterRequestHandlerInterceptor() { this.registeredInterceptors.Add(typeof(T)); this.container.Register(typeof(T), typeof(T), Lifestyle.Transient); return this; }

but in the current code it looks like this: public ServiceLayerConfiguration RegisterRequestHandlerInterceptor() where T : IRequestHandlerInterceptor { registeredInterceptors.Add(typeof(T)); return this; }

Did this get updated but the nuget package didn't?

bartdeleye commented 12 years ago

The registration part was moved in the version below, but the same signature is used to register the components. I don't think it makes a difference in this case. https://github.com/davybrion/Agatha/commit/ba8566ab73593ac9592426445b76c994e6c414fc#diff-0

michaelaird commented 12 years ago

I think i found the culprit.

Ninject 3 changed the method signature in this commit: https://github.com/ninject/ninject/commit/83c8f532103a09d0703718b0d5aa80dd1f1b10e5#diff-28