2
votes

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?

1
There mono and xamarin frameworks are optional and are not required. Also netcore45 is treated the same as win with NuGet. So I do not see how the modified profile changed anything. I would need more information such as - what was the error, what type of project was being used?Matt Ward
I am guessing that the issue is with Simple.OData.Client - the error seems strange to me since the PCL should work with MonoAndroid if the Xamarin PCL profiles are installed. It would be worth finding out if this is a NuGet 2 or NuGet 3 problem. It may be a NuGet 3 bug.Matt Ward
The Simple.OData.Client 4.8.1 NuGet package installs without any errors with Visual Studio 2013 and an Android project. So I suspect this might be a Visual Studio 2015 and NuGet 3 problem.Matt Ward
Thanks Matt. Yes, this is Simple.OData.Client. I will ask for more information about the error message and the development environment.Vagif Abilov

1 Answers

4
votes

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 (i.e. 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