simpleinjector / SimpleInjector

An easy, flexible, and fast Dependency Injection library that promotes best practice to steer developers towards the pit of success.
https://simpleinjector.org
MIT License
1.21k stars 155 forks source link

Silverlight no longer supported? #927

Closed daveblt closed 3 years ago

daveblt commented 3 years ago

I'm attempting to add SimpleInjector to our legacy Silverlight 5 app, which shares code between WPF and Xamarin apps. I tried adding via Nuget but got the output shown below. I am not sure if this is expected or not. Since the website still advertises that Silverlight is supported, I assume that some previous version did support it, but I don't see any commit message when support was officially dropped. Could you please point me to a version of SimpleInjector that I could use?

Attempting to gather dependency information for package 'SimpleInjector.5.3.2' with respect to project 'MyApp.Hub', targeting 'Silverlight,Version=v5.0'
Gathering dependency information took 10 ms
Attempting to resolve dependencies for package 'SimpleInjector.5.3.2' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'SimpleInjector.5.3.2'
Resolved actions to install package 'SimpleInjector.5.3.2'
Install failed. Rolling back...
Package 'SimpleInjector.5.3.2' does not exist in project 'MyApp.Hub'
Package 'SimpleInjector.5.3.2' does not exist in folder 'C:\git\MyApp\packages'
Executing nuget actions took 1.19 min
**Could not install package 'SimpleInjector 5.3.2'.** You are trying to install this package into a project that targets 'Silverlight,Version=v5.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Time Elapsed: 00:01:11.6984361
========== Finished ==========
dotnetjunkie commented 3 years ago

The current version doesn't support Silverlight any longer. If that's still on the homepage, that's an error.

If you wish to use Simple Injector on your legacy Silverlight project, try the last v4 release and if rhat doesn't work the latest v3 release. Silverlight has been deprecated gor so long that I have no idea what is the last release that supports Silverlight.

Something else you might want to try is to apply Pure DI, i.e. apply DI without a DI Container.

daveblt commented 3 years ago

Got it, thanks. I'll give that a try. We're sharing code which will utilize dependency injection between four platforms so it would be highly desirable to have the same code lines, even if they point at different SimpleInjector version. Thanks again!

daveblt commented 3 years ago

Looks like version 3.3.2 worked as far as installation. Version 4.10.2 gave the same message about not supporting Silverlight 5. Thanks again!