Bug 42786 - .NET Standard package install issues.
Summary: .NET Standard package install issues.
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 6.0.99
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2016-07-25 15:20 UTC by Blake Niemyjski
Modified: 2016-07-26 09:36 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Blake Niemyjski 2016-07-25 15:20:23 UTC
I run the exceptionless project http://github.com/exceptionless/Exceptionless.Net and we support PCL + .NET Standard 1.2 and we have been having lots of issues both with trying to get our nuget package (exceptionless) to install on both Windows and MacOS (latest versions >6.0.1)

Here are some of the package install issues we are seeing: 

Adding 'System.Security.Principal.Windows 4.0.0' to TestNetStandard.iOS.
Could not install package 'System.Security.Principal.Windows 4.0.0'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

---

	Adding Exceptionless...
WARNING: Exceptionless Package contains PowerShell scripts which will not be run.
Installing 'Exceptionless 4.0.1886'.
Added file 'Exceptionless.dll' to folder 'Exceptionless.4.0.1886/lib/net45'.
Added file 'Exceptionless.xml' to folder 'Exceptionless.4.0.1886/lib/net45'.
Added file 'Exceptionless.dll' to folder 'Exceptionless.4.0.1886/lib/portable46-net451+win81+wpa81'.
Added file 'Exceptionless.xml' to folder 'Exceptionless.4.0.1886/lib/portable46-net451+win81+wpa81'.
Added file 'Exceptionless.dll' to folder 'Exceptionless.4.0.1886/lib/netstandard1.2'.
Added file 'Exceptionless.xml' to folder 'Exceptionless.4.0.1886/lib/netstandard1.2'.
Added file 'Exceptionless.dll' to folder 'Exceptionless.4.0.1886/lib/netstandard1.3'.
Added file 'Exceptionless.xml' to folder 'Exceptionless.4.0.1886/lib/netstandard1.3'.
Added file 'Exceptionless.dll' to folder 'Exceptionless.4.0.1886/lib/netstandard1.4'.
Added file 'Exceptionless.xml' to folder 'Exceptionless.4.0.1886/lib/netstandard1.4'.
Added file 'Exceptionless.dll' to folder 'Exceptionless.4.0.1886/lib/netstandard1.5'.
Added file 'Exceptionless.xml' to folder 'Exceptionless.4.0.1886/lib/netstandard1.5'.
Added file 'readme.txt' to folder 'Exceptionless.4.0.1886'.
Added file 'exceptionless.psm1' to folder 'Exceptionless.4.0.1886/tools'.
Added file 'install.ps1' to folder 'Exceptionless.4.0.1886/tools'.
Added file 'uninstall.ps1' to folder 'Exceptionless.4.0.1886/tools'.
Added file 'Exceptionless.4.0.1886.nupkg' to folder 'Exceptionless.4.0.1886'.
Successfully installed 'Exceptionless 4.0.1886'.
Adding 'Exceptionless 4.0.1886' to TestApp.
Could not install package 'Exceptionless 4.0.1886'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarintvos10+xamarinwatchos10+xamarinios10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.



Downloading Exceptionless 4.0.1886...
'Exceptionless' already has a dependency defined for 'System.Collections'.

We would really appreciate it we could get some help here. I think there are some underlying issues with trying to install .net standard nuget packages. Maybe this is a bug with nuget 2.12?
Comment 2 Matt Ward 2016-07-25 17:17:57 UTC
It looks like you are using Xamarin Studio to install the NuGet package based on the output messages.

The error message 'already has a dependency defined for' is due to the version of NuGet being used not knowing about the new target framework, most likely NetStandard. The only fix is to use a more recent version of NuGet.

I suspect the other error message "Could not install package 'System.Security.Principal.Windows 4.0.0'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0'" is also because NuGet is too old. I believe you are not getting the 'already has a dependency defined for' error message since there is only one dependency group that uses the newer NetStandard target framework. The Exceptionless NuGet package has multiple dependency groups that use NetStandard.

If you are using Xamarin Studio then the beta channel should include support for NuGet 2.12. So you will need Xamarin Studio 6.0.2.69 or above.

If you are using Visual Studio then you will need to use Visual Studio 2013 or higher and use NuGet 2.12 in VS 2013, or NuGet 3.4 or above in VS 2015.
Comment 3 Blake Niemyjski 2016-07-25 19:51:48 UTC
I did get these from using the beta channel as well. I think the root issue is this: https://github.com/dotnet/buildtools/issues/877
Comment 4 Matt Ward 2016-07-26 09:36:27 UTC
The errors reported in this bug report are due to the NuGet version and not due to missing assembly list information. The missing assembly list information on Windows may well affect the build.

With Xamarin Studio 6.0.1 (build 9) from the stable channel on the Mac I get the following errors:

1) Installing ExceptionLess 4.0.1886 into a PCL project (Profile 78):

'Exceptionless' already has a dependency defined for 'System.Collections'.


2) Installing System.Security.Principal.Windows into a Xamarin.iOS project:

The 'System.Security.Principal.Windows 4.0.0' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.8.7.0'.

After installing just Version 6.0.2 (build 69) from the beta channel:


1) Installing ExceptionLess 4.0.1886 into a PCL project (Profile 78):

Could not install package 'Exceptionless 4.0.1886'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarintvos10+xamarinwatchos10+xamarinios10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

The above error is expected since Profile 78 is not supported by the Exceptionless NuGet package.

Switching the PCL profile to 259 which is supported by NetStandard then Exceptionless still cannot be installed into the PCL project with Xamarin Studio 6.0.2 (build 69). Even removing the portable46-net451+win81+wpa81 directory from the Exceptionless NuGet package does not allow it to be installed. I suspect this is because NuGet 2.12 does not map Netstandard to any PCL profile. If I switch the PCL project to profile 151, which seems to match the PCL profile in the Exceptionless NuGet package, then Xamarin Studio 6.0.2 (build 69) and Xamarin Studio 6.1 can install the NuGet package into the PCL project.

Also it looks like you cannot install Exceptionless into a PCL profile 259 project using Xamarin Studio 6.1 even though it uses NuGet 3.4.3 and does map PCL profiles to NetStandard, unless the portable46 directory is removed from the NuGet package. I suspect NuGet here is taking what it thinks is the closest framework, which happens to the PCL framework, and not the NetStandard assemblies, so the install fails since Profile 259 is not compatible with the Exceptionless NuGet package.

2) Installing System.Security.Principal.Windows into a Xamarin.iOS project:

Installs without any errors.

In summary:

The Exceptionless NuGet package can be successfully with Xamarin Studio 6.0.2 (build 69) from the beta channel into a Xamarin.iOS project and a PCL project with a compatible PCL profile, such as Profile 151.