##Reproduction of NuGet error installing multi-targeted .NET Core class library
-
Create a .NET Core class library using Visual Studio 2015 Update 2.
-
Add a target framework for .NETPortable,Version=v4.5,Profile=Profile111.
- Add framework assemblies
- Change the netstandard target to 1.3
- Add a dependency for System.ComponentModel.Annotations
-
Execute
dotnet pack
to compile and build a NuGet package. -
Copy the package to a local NuGet source.
-
Create both an Android and iOS project.
-
Add the multi-targeted version of the .NET Core Class Library.
-
The following error will take place and the package install will be rolled back:
Failed to add reference to 'System.Collections'. Please make sure that it is in the Global Assembly Cache.
-
The same error will occur with the portable only version of the .NET Core Class Library.
-
The error will not occur with the netcore only version of the .NET Core Class Library.
If System.Collections is removed from framework assemblies, then the following error takes place:
Failed to add reference to 'System.ComponentModel'. Please make sure that it is in the Global Assembly Cache.
- Both the multi-targeted and portable versions of the .NET Core Class Library will install successfully.