I've started a new Umbraco Cloud project and I thought it would be a nice idea to use LightInject for my IOC.
After installing the latest version through NuGet I got the following error:
umbraco Method not found: 'System.__Canon LightInject.IServiceFactory.GetInstance()'.
This is because Umbraco Deploy uses an older version of LightInject. This version is not installed through NuGet so I didn't notice this before.
After reverting my changes I added a reference to the LightInject dll files in the bin folder. This is not best practise, but since Umbraco Cloud has the bin folder in Github it's working. I also added LightInject.Mvc.dll v1.1.0 and LightInject.WebApi.dll v1.1.0 to the bin folder because I need those too. Now everything is working again and I can use LightInject with Umbraco Cloud.
I'm not sure if this is the best way to use LightInject with Umbraco Cloud and what happens if Umbraco Deploy decides to use a newer version. Any feedback is welcome!
No I haven't tried that. Not sure if it would work. Umbraco Deploy uses LightInject 4.1.5 and LightInject.Web 1.1.0. The latest versions are LightInject 5.1.1 and LightInject.Web 2.0.0. Since these are major version changes it will probably have some breaking changes.
For now I'll just use the same version that Umbraco Deploy uses. That didn't cause any other issues yet.
Using LightInject on Umbraco Cloud
Hello,
I've started a new Umbraco Cloud project and I thought it would be a nice idea to use LightInject for my IOC.
After installing the latest version through NuGet I got the following error:
This is because Umbraco Deploy uses an older version of LightInject. This version is not installed through NuGet so I didn't notice this before.
After reverting my changes I added a reference to the LightInject dll files in the bin folder. This is not best practise, but since Umbraco Cloud has the bin folder in Github it's working. I also added LightInject.Mvc.dll v1.1.0 and LightInject.WebApi.dll v1.1.0 to the bin folder because I need those too. Now everything is working again and I can use LightInject with Umbraco Cloud.
I'm not sure if this is the best way to use LightInject with Umbraco Cloud and what happens if Umbraco Deploy decides to use a newer version. Any feedback is welcome!
Jeroen
Started a topic, but the discussion continued on Twitter ;-).
Here is the thread: https://twitter.com/j_breuer/status/946390791840288770
Jeroen
Have you tried using the latest version and adding an assembly redirect to the web.config?
No I haven't tried that. Not sure if it would work. Umbraco Deploy uses LightInject 4.1.5 and LightInject.Web 1.1.0. The latest versions are LightInject 5.1.1 and LightInject.Web 2.0.0. Since these are major version changes it will probably have some breaking changes.
For now I'll just use the same version that Umbraco Deploy uses. That didn't cause any other issues yet.
Jeroen
Okidoki.
Well, LightInject doesn't make great release notes, so there's currently no way of knowing. We'll have to see.
In any case, if we decide to upgrade our version, the automatic upgrader on Cloud should handle the version difference with yours automatically.
is working on a reply...