dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.42k stars 4.76k forks source link

System.Data.Common from a PCL project #15781

Closed joshfree closed 4 years ago

joshfree commented 9 years ago

Posting on behalf of a customer report via nuget.org

I would really like to be able to reference System.Data.Common from a PCL project - however the >current NuGet package doesn't support PCL. Would you consider adding support for PCL? Otherwise, I am planning on implementing it in a separate repository - I'm looking at using Type >Forwarding based on approach here: http://stackoverflow.com/questions/21357321/handling-missing->types-in-pcl-with-real-types-existing-on-some-of-the-platforms Kind Regards Darrell

/cc @saurabh500 @YoungGah

mellinoe commented 9 years ago

Not sure that this is really related to System.Data.Common. You can't reference any of our NuGet packages from a PCL, as long as you are talking about old "profile-based" PCL projects. You should be able to reference them just fine from a new PCL project. For example, a new PCL project targeting dnxcore50/net46 should be able to reference the System.Data.Common package.

dazinator commented 9 years ago

Thanks @mellinoe that answers my question.

My current dilemma is that I really want to compile (and distribute) my custom ADO.NET provider as a PCL that can be used with xamarin projects (monotouch and monodroid) not just dnxcore50 + net46

As soon as I try to target anything beyond dnxcore50 + net46 from my PCL project, then I can no longer pull in System.Data.Common NuGet Package - so I can no longer compile my ADO.Net provider as a PCL!

So, unless you guys are going to bring System.Data.Common to MonoTouch and MonoDroid anytime soon (grin), I'll continue down the path of creating a portable version of System.Data.Common over here: https://github.com/dazinator/Portable.System.Data.Common - having copied large portions of your code over - I am hoping to add support for xamarin.

P.S Not sure if you are interested in checking this, but when I tested adding the System.Data.Common nuget package to a new PCL project targeting only dnxcore50 + net46 - it would only work with the "latest stable" version of the package. The "latest pre-release" version kept failing during the install and was rolled back.

mellinoe commented 9 years ago

I really want to compile (and distribute) my custom ADO.NET provider as a PCL that can be used with xamarin projects (monotouch and monodroid) not just dnxcore50 + net46

I think this is the sort of thing that our ".NET Platform Standard" work is hoping to address, but until we have finalized our plans/work for that, and until the xamarin platforms have "opted in" to the new paradigm, then I think you will be limited to the platforms that we support explicitly in the packages currently. @ericstj / @davidfowl is that accurate (with regards to the .NET Platform Standard) ?

Regarding this:

would only work with the "latest stable" version of the package. The "latest pre-release" version kept failing during the install and was rolled back.

I'm not exactly sure about that. Perhaps your version of NuGet needs to be updated, or something of that sort.

ericstj commented 8 years ago

@chcosta after you change the targeting of this library with https://github.com/dotnet/corefx/issues/4802 can you update the package to add a folder for portable-a+b+c similar to https://github.com/dotnet/corefx/blob/master/src/System.Collections.Immutable/pkg/System.Collections.Immutable.pkgproj

chcosta commented 8 years ago

The fix for this has been checked in and will be in the next package push.