zcz527 / autofac

Automatically exported from code.google.com/p/autofac
Other
0 stars 0 forks source link

Portable Class Library for Autofac.Extras.CommonServiceLocator #393

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We are using the PCL build of Autofac but would also like to use a PCL build of 
Autofac.Extras.CommonServiceLocator (which would reference the PCL build of 
Microsoft.Practices.ServiceLocation).

Original issue reported on code.google.com by ejb...@gmail.com on 16 Nov 2012 at 7:32

GoogleCodeExporter commented 8 years ago

Original comment by travis.illig on 16 Nov 2012 at 8:08

GoogleCodeExporter commented 8 years ago
I implemented this locally by:

* following these instructions to convert Autofac.Extras.CommonServiceLocator 
to a PCL: 
http://geekswithblogs.net/imilovanovic/archive/2012/08/31/vs2012---how-to-manual
ly-convert-.net-class-library-to.aspx
* matched the same PCL targets as the main Autofac assembly
* removed ComVisible (and corresponding using) from AssemblyInfo.cs
* removed the CommonServiceLocator NuGet package (since it doesn't appear to 
support the PCL yet)
* copied the PCL build of CommonServiceLocator to 
lib/CommonServiceLocator/Portable from 
http://commonservicelocator.codeplex.com/releases/view/17694
* referenced that DLL directly from Autofac.Extras.CommonServiceLocator

Original comment by ejb...@gmail.com on 16 Nov 2012 at 11:23

GoogleCodeExporter commented 8 years ago

Original comment by travis.illig on 3 Dec 2012 at 4:20

GoogleCodeExporter commented 8 years ago
I think I have this working, but I'm not sure what to do with the .nuspec for 
it quite yet. There is a Portable.CommonServiceLocator package that includes 
it, but including a reference to that will potentially break people who want to 
use Enteprise Library, which specifically references CommonServiceLocator.

I have some conditional nuspec syntax that I'm going to try out, but I've 
opened a StackOverflow question to see if I'm doing things right:
http://stackoverflow.com/questions/13688536/how-do-i-specify-conditional-depende
ncies-based-on-target-framework-in-nuget

Original comment by travis.illig on 3 Dec 2012 at 5:29

GoogleCodeExporter commented 8 years ago
Switched Autofac.Extras.CommonServiceLocator to be a PCL. Included in changeset 
3bb63459f143.

I still have the open question about whether I'm doing the right thing in the 
.nuspec so I don't break anyone wanting to use Enterprise Library.

I've also chimed in on the PCL work item on the actual CommonServiceLocator 
project to see if we can just get them to include the PCL version in the 
official package so we don't have to do fancy workarounds to get things 
functioning.
http://commonservicelocator.codeplex.com/workitem/15106

I'm going to keep this item open until one question or the other gets resolved 
and we're sure we're doing the right thing.

Original comment by travis.illig on 3 Dec 2012 at 5:46

GoogleCodeExporter commented 8 years ago
From StackOverflow, the one person who answered me says what I've got in the 
NuGet package is right as far as the dependencies are concerned. I'm going to 
close this issue and if we discover there are problems with the dependency list 
we can open a different issue or just fix it then.

Longer term, hopefully the official CSL package will include the portable 
version so all that can go away.

Original comment by travis.illig on 3 Dec 2012 at 11:02

GoogleCodeExporter commented 8 years ago
Great; thanks!

Original comment by ejb...@gmail.com on 4 Dec 2012 at 2:52