autofac / Autofac

An addictive .NET IoC container
https://autofac.org
MIT License
4.47k stars 836 forks source link

Support for Windows Phone 8.1 Universal Applications #512

Closed kiangtengl closed 10 years ago

kiangtengl commented 10 years ago

When will Autofac be updated to support Windows Phone 8.1? Currently if one attempts to install Autofac from Nuget he will encounter this error:

Could not install package 'Autofac 3.3.1'. You are trying to install this package into a project that targets 'WindowsPhoneApp,Version=v8.1', 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.
tillig commented 10 years ago

We target Windows Phone 8 which should be backwards-compatible with WP8.1. The additions to WP8.1 are for updated WinRT and XAML support (per the PCL documentation ) - features Autofac doesn't need.

I am able to create a new WP8.1 project and manually add a binary reference to Autofac (not through NuGet) and it all works just fine. However, trying through NuGet I see the same error message reported.

NuGet 2.8.1 was just released with support for WP8.1 but I'm guessing they don't see WP8.0 as compatible. I feel like it should be.

Looking at the discussion topics on the NuGet CodePlex site, it appears there is some challenge with NuGet and WP8.1 compatibility. Some folks specifically have 8.1 compatible packages and they're still not being seen as compatible.

While I do see that WP8.1 has been added as another PCL target, I'm not clear whether we need to add that as a specific target or whether there's a bug in NuGet that needs to be fixed. I'll try following up on the NuGet forum.

tillig commented 10 years ago

I've started the discussion on the NuGet forum here: https://nuget.codeplex.com/discussions/542234

kiangtengl commented 10 years ago

Yeah it seems to be a NuGet issue. I've been having problems with other libraries as well. Will get back to you when I get more information on this.

kiangtengl commented 10 years ago

It seems that by switching the project target from profile 78 -> profile 259, we will be able to support both WP8 and WP8.1.

See https://github.com/reactiveui/ReactiveUI/pull/552

tillig commented 10 years ago

It appears this is also the case in MvvmCross/MvvmCross#660

There is some good discussion over there and it appears they've tested Profile259 as working. They also seem to have tested out that a Profile78 assembly can reference a Profile259 assembly.

The challenge will be that it requires VS 2013 Update 2, which isn't that big of a deal but it's still in RC so it will probably break the MyGet build unless they have Update 2 in place. (I've got a tweet out to them to find out.)

tillig commented 10 years ago

Word has it that Update 2 is not on the MyGet build server but it will be when it RTMs.

https://twitter.com/MyGetTeam/status/456818588003749888

It might be good to hold off on the switch until the build server supports it.

AArnott commented 10 years ago

The wpa81 platform is a different platform than wp80 and wp81. You must at least recompile for wpa81 and add references to those files in your nuspec file to get support for it. NuGet will never allow wp80 compiled assemblies to be applied to wpa81 apps.

Of course if you can use a PCL that targets wp80 and wpa81 concurrently and still get it all to compile, then you're gold.

henricj commented 10 years ago

Update 2 support is now available:

https://twitter.com/MyGetTeam/statuses/465922380314206208

zeroskyx commented 10 years ago

Any news on the topic? Would be really great to be able to use AutoFac for Universal WP8.1 apps.

Keep up the great work!

tillig commented 10 years ago

Sorry, had to take care of some infrastructure/build stuff that would allow us to move forward on a lot of things. Spent... pretty much all day yesterday on that. Hopefully this will be next, but not today. (I should probably actually work today. :) )

zeroskyx commented 10 years ago

Hi tillig,

wow -- thanks for the rapid response. No need to hurry THAT much -- I was just wondering if there was any news on the topic. But of course I'm glad you're on it.

Thanks so much again!

tillig commented 10 years ago

After all is said and done, with Update 2 in place and adding WPA 8.1 support, it'll be Profile328.

I am doing some testing with that now to make sure things stay copacetic.

tillig commented 10 years ago

Just pushed Autofac 3.5.0, which includes the WPA 8.1 update. Working on CommonServiceLocator and MvvmCross - the other two PCLs we have.

tillig commented 10 years ago

Pushed Autofac.Extras.CommonServiceLocator 3.2.0 and Autofac.Extras.MvvmCross 3.2.0 with the WPA 8.1 updates.

zeroskyx commented 10 years ago

Awesome work mate; works like a charm! Thank so much again for your effort =)