LightInject icon indicating copy to clipboard operation
LightInject copied to clipboard

LightInject.Mvc 1.0.0.4 doesn't work with LightInject 4.1.0

Open Kurira opened this issue 10 years ago • 7 comments

Seems like LightInject.Mvc is still trying to use void methods, even though they there changed with https://github.com/seesharper/LightInject/issues/295.

[MissingMethodException: Method not found: 'Void LightInject.IServiceRegistry.Register(System.Type, LightInject.ILifetime)'.]
   LightInject.MvcContainerExtensions.RegisterControllers(IServiceRegistry serviceRegistry, Assembly[] assemblies) in
c:\Users\bri\Documents\GitHub\LightInject\NuGet\Build\Net45\LightInject.Mvc\LightInject.Mvc.cs:64

Kurira avatar Aug 26 '16 06:08 Kurira

I would send a pull request, but not sure how the building works. @seesharper could you provide a quick readme on how to build the packages in the oldsource folder with the code in the new src?

geirsagberg avatar Aug 26 '16 07:08 geirsagberg

I going to move Mvc into its own repo like most of the other extensions/integrations.

seesharper avatar Aug 26 '16 10:08 seesharper

A new version LightInject.Mvc 1.1.0 has been published to the official NuGet feed. I have also updated LightInject.Web so that they all follow the semver convention.

seesharper avatar Aug 26 '16 13:08 seesharper

I'm getting the same exception message. Moved from v4.0.11 to v4.1.0 in a project that uses LightInject.Microsoft.DependencyInjection v1.0.1

In the simplest .Net Web Application project (both regular and Core), when hitting serviceContainer.CreateServiceProvider(), an exception is thrown:

Method not found: 'Void LightInject.IServiceRegistry.Register(System.Func`2<LightInject.IServiceFactory,!!0>, LightInject.ILifetime)'.

In v.4.0.11 everything works well.

ghost avatar Aug 27 '16 08:08 ghost

Confirmed that 1.1.0 works. @Droritos make sure your compiled project is using correct versions by going to bin folder and checking if light inject mvc and web assemblies are really 1.1.0.

Kurira avatar Aug 29 '16 11:08 Kurira

@Kurira, I only mentioned I'm getting the same type of error to indicate there's a problem with the 4.1.0 version. I'm using a .net core app where LightInject.Web does not support yet.

ghost avatar Aug 30 '16 10:08 ghost

I have a pull request https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/pull/5 that should fix usage in .NET Core.

geirsagberg avatar Aug 30 '16 10:08 geirsagberg