简体   繁体   中英

Why does a PCL NuGet package fail to target Xamarin platform?

I maintain an open source PCL library packaged as a NuGet that targets (among others) Xamarin platforms. It's been succesfully used by many developers. Recently I received an issue report where a developer said he had to patch my NuGet package to be able to include the package in his app.

He changed it from: portable-net45+win+win8+wp8+wpa81

to: portable-net45+wp8+wpa81+netcore45+monoandroid1+xamarin.ios10

While I didn't explicitly specify xamarin targets in my package nuspec, it has never been a problem when building Xamarin apps. Apparently it is now. Can this have something with Visual Studio 2015, recent Xamarin updates (that I didn't verify with my lib)? Any other reason?

I refer to the answer by Matt Ward on a Xamarin forum where he says:

A monoandroid/xamarin.ios in the lib directory is not required in the NuGet package in order for it to be used in a Xamarin project. If the NuGet package contains a compatible portable class library (PCL) then that can be used. You only need lib/monoandroid or lib/xamarin.ios if you have a library which uses part of monoandroid or xamarin.ios (ie is platform specific).

Also the monoandroid and xamarin.ios is not required in the portable class library profile in the NuGet package. These are treated as optional by NuGet. Json.NET for example does not any reference to monoandroid or xamarin.iOS in its NuGet package and that can be used by Xamarin projects.

The problem with the Simple.OData.Client NuGet package with NuGet 3 is that the extra win in the PCL profile directory. This seems to be a bug in NuGet 3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM