I have written a small iOS library that I would like to distribute internally in my organisation as a NuGet (via MyGet.org). To do so I simply ...
- Added the
NuGet.Build.Packaging
package to the library project - Ticked the project's
Options >> NuGet Packge >> Build >> Create a NuGet Package ...
option - Built the NuGet package
- Submitted it to my feed on MyGet.org
Now, to test it I created a new Xamarin Forms app with only an iOS app and ...
- Ensured the iOS app built ok (it did)
- Installed the new NuGet package into iOS app (from my MyGet.org feed).
The lib is only 2Mb and doesn't really reference alot of other libraries but the Package console window gets filled with log entries describing how existing references got uninstalled (System.Core being one of them) and new ones where added instead. In the end the iOS app lo longer builds. I get extremely basic error such as: Predefined type System.Object' is not defined or imported (CS0518)
on the Application
class in Main.cs.
More details:
The library I package in NuGet relies on another .NET Standard 2.0 library (home brewn).
Question:
Am I doing this wrong? Are there more steps I need to take in order to wrap a Xamarin.iOS library as a NuGet package?
This is the log from the Package manager when I install my NuGet package:
Attempting to gather dependency information for package 'MA.XamarinForms.Security.iOS.0.1.0-beta' with respect to project 'spike.security.iOS', targeting 'Xamarin.iOS,Version=v1.0'
GET https://www.myget.org/F/mycompany-mobileapps/api/v3/registration1/ma.xamarinforms.security.ios/index.json
OK https://www.myget.org/F/mycompany-mobileapps/api/v3/registration1/ma.xamarinforms.security.ios/index.json 46ms
GET https://www.myget.org/F/mycompany-mobileapps/api/v3/registration1/xamarin.forms/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/xamarin.forms/index.json
NotFound https://www.myget.org/F/mycompany-mobileapps/api/v3/registration1/xamarin.forms/index.json 57ms
OK https://api.nuget.org/v3/registration3-gz-semver2/xamarin.forms/index.json 197ms
GET https://api.nuget.org/v3/registration3-gz-semver2/xamarin.forms/page/1.0.6186/1.4.4.6387.json
GET https://api.nuget.org/v3/registration3-gz-semver2/xamarin.forms/page/1.4.4.6391/2.3.3.180.json
GET https://api.nuget.org/v3/registration3-gz-semver2/xamarin.forms/page/2.3.3.193/2.5.0.122203.json
OK https://api.nuget.org/v3/registration3-gz-semver2/xamarin.forms/page/1.0.6186/1.4.4.6387.json 147ms
OK https://api.nuget.org/v3/registration3-gz-semver2/xamarin.forms/page/1.4.4.6391/2.3.3.180.json 200ms
OK https://api.nuget.org/v3/registration3-gz-semver2/xamarin.forms/page/2.3.3.193/2.5.0.122203.json 671ms
Total number of results gathered : 5
Gathering dependency information took 946.97 ms
Summary of time taken to gather dependencies per source :
https://www.myget.org/F/mycompany-mobileapps/api/v3/index.json - 106.76 ms
/Volumes/Stuff/Source/Spikes/spike.security/packages - 2.94 ms
https://api.nuget.org/v3/index.json - 896.19 ms
Attempting to resolve dependencies for package 'MA.XamarinForms.Security.iOS.0.1.0-beta' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'MA.XamarinForms.Security.iOS.0.1.0-beta'
Resolved actions to install package 'MA.XamarinForms.Security.iOS.0.1.0-beta'
Retrieving package 'MA.XamarinForms.Security.iOS 0.1.0-beta' from 'Mobile Apps on MyGet'.
For adding package 'MA.XamarinForms.Security.iOS.0.1.0-beta' to project 'spike.security.iOS' that targets 'xamarinios10'.
For adding package 'MA.XamarinForms.Security.iOS.0.1.0-beta' to project 'spike.security.iOS' that targets 'xamarinios10'.
Adding package 'MA.XamarinForms.Security.iOS.0.1.0-beta' to folder '/Volumes/Stuff/Source/Spikes/spike.security/packages'
Added package 'MA.XamarinForms.Security.iOS.0.1.0-beta' to folder '/Volumes/Stuff/Source/Spikes/spike.security/packages'
Added package 'MA.XamarinForms.Security.iOS.0.1.0-beta' to folder '/Volumes/Stuff/Source/Spikes/spike.security/packages' from source 'https://www.myget.org/F/mycompany-mobileapps/api/v3/index.json'
Added reference 'Microsoft.Win32.Primitives' to project 'spike.security.iOS'.
Added reference 'MobileApps.Security' to project 'spike.security.iOS'.
Added reference 'mscorlib' to project 'spike.security.iOS'.
Added reference 'netstandard' to project 'spike.security.iOS'.
Added reference 'System.AppContext' to project 'spike.security.iOS'.
Added reference 'System.Collections.Concurrent' to project 'spike.security.iOS'.
Added reference 'System.Collections' to project 'spike.security.iOS'.
Added reference 'System.Collections.NonGeneric' to project 'spike.security.iOS'.
Added reference 'System.Collections.Specialized' to project 'spike.security.iOS'.
Added reference 'System.ComponentModel.Composition' to project 'spike.security.iOS'.
Added reference 'System.ComponentModel' to project 'spike.security.iOS'.
Added reference 'System.ComponentModel.EventBasedAsync' to project 'spike.security.iOS'.
Added reference 'System.ComponentModel.Primitives' to project 'spike.security.iOS'.
Added reference 'System.ComponentModel.TypeConverter' to project 'spike.security.iOS'.
Added reference 'System.Console' to project 'spike.security.iOS'.
Removed reference 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' from project 'spike.security.iOS'.
Added reference 'System.Core' to project 'spike.security.iOS'.
Added reference 'System.Data.Common' to project 'spike.security.iOS'.
Added reference 'System.Data' to project 'spike.security.iOS'.
Added reference 'System.Diagnostics.Contracts' to project 'spike.security.iOS'.
Added reference 'System.Diagnostics.Debug' to project 'spike.security.iOS'.
Added reference 'System.Diagnostics.FileVersionInfo' to project 'spike.security.iOS'.
Added reference 'System.Diagnostics.Process' to project 'spike.security.iOS'.
Added reference 'System.Diagnostics.StackTrace' to project 'spike.security.iOS'.
Added reference 'System.Diagnostics.TextWriterTraceListener' to project 'spike.security.iOS'.
Added reference 'System.Diagnostics.Tools' to project 'spike.security.iOS'.
Added reference 'System.Diagnostics.TraceSource' to project 'spike.security.iOS'.
Added reference 'System.Diagnostics.Tracing' to project 'spike.security.iOS'.
Removed reference 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' from project 'spike.security.iOS'.
Added reference 'System' to project 'spike.security.iOS'.
Added reference 'System.Drawing' to project 'spike.security.iOS'.
Added reference 'System.Drawing.Primitives' to project 'spike.security.iOS'.
Added reference 'System.Dynamic.Runtime' to project 'spike.security.iOS'.
Added reference 'System.Globalization.Calendars' to project 'spike.security.iOS'.
Added reference 'System.Globalization' to project 'spike.security.iOS'.
Added reference 'System.Globalization.Extensions' to project 'spike.security.iOS'.
Added reference 'System.IO.Compression' to project 'spike.security.iOS'.
Added reference 'System.IO.Compression.FileSystem' to project 'spike.security.iOS'.
Added reference 'System.IO.Compression.ZipFile' to project 'spike.security.iOS'.
Added reference 'System.IO' to project 'spike.security.iOS'.
Added reference 'System.IO.FileSystem' to project 'spike.security.iOS'.
Added reference 'System.IO.FileSystem.DriveInfo' to project 'spike.security.iOS'.
Added reference 'System.IO.FileSystem.Primitives' to project 'spike.security.iOS'.
Added reference 'System.IO.FileSystem.Watcher' to project 'spike.security.iOS'.
Added reference 'System.IO.IsolatedStorage' to project 'spike.security.iOS'.
Added reference 'System.IO.MemoryMappedFiles' to project 'spike.security.iOS'.
Added reference 'System.IO.Pipes' to project 'spike.security.iOS'.
Added reference 'System.IO.UnmanagedMemoryStream' to project 'spike.security.iOS'.
Added reference 'System.Linq' to project 'spike.security.iOS'.
Added reference 'System.Linq.Expressions' to project 'spike.security.iOS'.
Added reference 'System.Linq.Parallel' to project 'spike.security.iOS'.
Added reference 'System.Linq.Queryable' to project 'spike.security.iOS'.
Added reference 'System.Net' to project 'spike.security.iOS'.
Added reference 'System.Net.Http' to project 'spike.security.iOS'.
Added reference 'System.Net.NameResolution' to project 'spike.security.iOS'.
Added reference 'System.Net.NetworkInformation' to project 'spike.security.iOS'.
Added reference 'System.Net.Ping' to project 'spike.security.iOS'.
Added reference 'System.Net.Primitives' to project 'spike.security.iOS'.
Added reference 'System.Net.Requests' to project 'spike.security.iOS'.
Added reference 'System.Net.Security' to project 'spike.security.iOS'.
Added reference 'System.Net.Sockets' to project 'spike.security.iOS'.
Added reference 'System.Net.WebHeaderCollection' to project 'spike.security.iOS'.
Added reference 'System.Net.WebSockets.Client' to project 'spike.security.iOS'.
Added reference 'System.Net.WebSockets' to project 'spike.security.iOS'.
Added reference 'System.Numerics' to project 'spike.security.iOS'.
Added reference 'System.ObjectModel' to project 'spike.security.iOS'.
Added reference 'System.Reflection' to project 'spike.security.iOS'.
Added reference 'System.Reflection.Extensions' to project 'spike.security.iOS'.
Added reference 'System.Reflection.Primitives' to project 'spike.security.iOS'.
Added reference 'System.Resources.Reader' to project 'spike.security.iOS'.
Added reference 'System.Resources.ResourceManager' to project 'spike.security.iOS'.
Added reference 'System.Resources.Writer' to project 'spike.security.iOS'.
Added reference 'System.Runtime.CompilerServices.VisualC' to project 'spike.security.iOS'.
Added reference 'System.Runtime' to project 'spike.security.iOS'.
Added reference 'System.Runtime.Extensions' to project 'spike.security.iOS'.
Added reference 'System.Runtime.Handles' to project 'spike.security.iOS'.
Added reference 'System.Runtime.InteropServices' to project 'spike.security.iOS'.
Added reference 'System.Runtime.InteropServices.RuntimeInformation' to project 'spike.security.iOS'.
Added reference 'System.Runtime.Numerics' to project 'spike.security.iOS'.
Added reference 'System.Runtime.Serialization' to project 'spike.security.iOS'.
Added reference 'System.Runtime.Serialization.Formatters' to project 'spike.security.iOS'.
Added reference 'System.Runtime.Serialization.Json' to project 'spike.security.iOS'.
Added reference 'System.Runtime.Serialization.Primitives' to project 'spike.security.iOS'.
Added reference 'System.Runtime.Serialization.Xml' to project 'spike.security.iOS'.
Added reference 'System.Security.Claims' to project 'spike.security.iOS'.
Added reference 'System.Security.Cryptography.Algorithms' to project 'spike.security.iOS'.
Added reference 'System.Security.Cryptography.Csp' to project 'spike.security.iOS'.
Added reference 'System.Security.Cryptography.Encoding' to project 'spike.security.iOS'.
Added reference 'System.Security.Cryptography.Primitives' to project 'spike.security.iOS'.
Added reference 'System.Security.Cryptography.X509Certificates' to project 'spike.security.iOS'.
Added reference 'System.Security.Principal' to project 'spike.security.iOS'.
Added reference 'System.Security.SecureString' to project 'spike.security.iOS'.
Added reference 'System.ServiceModel.Web' to project 'spike.security.iOS'.
Added reference 'System.Text.Encoding' to project 'spike.security.iOS'.
Added reference 'System.Text.Encoding.Extensions' to project 'spike.security.iOS'.
Added reference 'System.Text.RegularExpressions' to project 'spike.security.iOS'.
Added reference 'System.Threading' to project 'spike.security.iOS'.
Added reference 'System.Threading.Overlapped' to project 'spike.security.iOS'.
Added reference 'System.Threading.Tasks' to project 'spike.security.iOS'.
Added reference 'System.Threading.Tasks.Parallel' to project 'spike.security.iOS'.
Added reference 'System.Threading.Thread' to project 'spike.security.iOS'.
Added reference 'System.Threading.ThreadPool' to project 'spike.security.iOS'.
Added reference 'System.Threading.Timer' to project 'spike.security.iOS'.
Added reference 'System.Transactions' to project 'spike.security.iOS'.
Added reference 'System.ValueTuple' to project 'spike.security.iOS'.
Added reference 'System.Web' to project 'spike.security.iOS'.
Added reference 'System.Windows' to project 'spike.security.iOS'.
Removed reference 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' from project 'spike.security.iOS'.
Added reference 'System.Xml' to project 'spike.security.iOS'.
Added reference 'System.Xml.Linq' to project 'spike.security.iOS'.
Added reference 'System.Xml.ReaderWriter' to project 'spike.security.iOS'.
Added reference 'System.Xml.Serialization' to project 'spike.security.iOS'.
Added reference 'System.Xml.XDocument' to project 'spike.security.iOS'.
Added reference 'System.Xml.XmlDocument' to project 'spike.security.iOS'.
Added reference 'System.Xml.XmlSerializer' to project 'spike.security.iOS'.
Added reference 'System.Xml.XPath' to project 'spike.security.iOS'.
Added reference 'System.Xml.XPath.XDocument' to project 'spike.security.iOS'.
Added reference 'Xamarin.LocalAuth.iOS' to project 'spike.security.iOS'.
Added package 'MA.XamarinForms.Security.iOS.0.1.0-beta' to 'packages.config'
Added file 'packages.config' to project 'spike.security.iOS'.
Successfully installed 'MA.XamarinForms.Security.iOS 0.1.0-beta' to spike.security.iOS
Executing nuget actions took 2.08 min
MA.XamarinForms.Security.iOS successfully added.