Bug 38215 - I can't add any nugets to any project
Summary: I can't add any nugets to any project
Status: RESOLVED DUPLICATE of bug 37767
Alias: None
Product: Runtime
Classification: Mono
Component: packaging ()
Version: unspecified
Hardware: PC Mac OS
: --- critical
Target Milestone: ---
Assignee: Alexis Christoforides
URL:
Depends on:
Blocks:
 
Reported: 2016-01-30 01:09 UTC by Alan McGovern
Modified: 2016-02-01 11:23 UTC (History)
2 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 GitHub or Developer Community 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 DUPLICATE of bug 37767

Description Alan McGovern 2016-01-30 01:09:12 UTC
Adding NUnit...
Downloading NUnit 3.0.1...
Installing 'NUnit 3.0.1'.
Added file 'LICENSE.txt' to folder 'NUnit.3.0.1'.
Added file 'NOTICES.txt' to folder 'NUnit.3.0.1'.
Added file 'CHANGES.txt' to folder 'NUnit.3.0.1'.
Added file 'nunit.framework.dll' to folder 'NUnit.3.0.1/lib/net20'.
Added file 'nunit.framework.xml' to folder 'NUnit.3.0.1/lib/net20'.
Added file 'nunit.framework.dll' to folder 'NUnit.3.0.1/lib/net40'.
Added file 'nunit.framework.xml' to folder 'NUnit.3.0.1/lib/net40'.
Added file 'nunit.framework.dll' to folder 'NUnit.3.0.1/lib/net45'.
Added file 'nunit.framework.xml' to folder 'NUnit.3.0.1/lib/net45'.
Added file 'nunit.framework.dll' to folder 'NUnit.3.0.1/lib/dotnet'.
Added file 'nunit.framework.xml' to folder 'NUnit.3.0.1/lib/dotnet'.
Added file 'nunit.framework.dll' to folder 'NUnit.3.0.1/lib/portable-net45+win8+wp8+wpa81+Xamarin.Mac+MonoAndroid10+MonoTouch10+Xamarin.iOS10'.
Added file 'nunit.framework.xml' to folder 'NUnit.3.0.1/lib/portable-net45+win8+wp8+wpa81+Xamarin.Mac+MonoAndroid10+MonoTouch10+Xamarin.iOS10'.
Added file 'NUnit.3.0.1.nupkg' to folder 'NUnit.3.0.1'.
Successfully installed 'NUnit 3.0.1'.
Adding 'NUnit 3.0.1' to gtk_test_runner.
Specified argument was out of the range of valid values.
Parameter name: supportedFrameworks

I created a new gtk-sharp library project and triggered this while adding the nunit 3 nuget. I also triggered the same thing yesterday trying to add ModernHttpClient to a xamarin.ios application.

I have: Mono JIT compiler version 4.3.2 (mono-4.3.2-branch/f87e371 Tue Jan 26 18:33:29 EST 2016)

also monodevelop/master
Comment 1 Matt Ward 2016-01-30 09:00:05 UTC
I have seen this error reported on Windows before although you are on Mac. The problem usually that the PCL profiles are messed up. On Windows the installer will add Xamarin PCL .xml files into PCL directories which have no PCL .xml files from Microsoft. So you end up in a situation where a PCL directory only has the Xamarin PCL .xml files which are treated as optional. Then you end up with this exception from this line of code:

https://github.com/mrward/nuget/blob/2.8.7-monodevelop/src/Core/NETPortable/NetPortableProfile.cs#L60-L63

Although I have no idea how this happens on the Mac since I am sure the Python script that generates these files should only add Xamarin PCL .xml files to existing directories.

The PCL .xml files are stored in several SupportedFrameworks directories inside:

/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks/.NETPortable
Comment 2 Matt Ward 2016-02-01 10:42:06 UTC
This is a packaging problem. I downloaded and installed MonoFramework-MDK-4.3.2.338.macos10.xamarin.universal.pkg (mono-4.3.2-branch/f87e371 Tue Jan 26 18:33:29 EST 2016) and can repro the error.

Looking at any SupportedFrameworks directory for Mono 4.3.2 they only have the Mono and Xamarin PCL profile .xml files. They are missing the ones provided by Microsoft. Taking Profile78

/Library/Frameworks/Mono.framework/Versions/4.3.2/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/SupportedFrameworks

MonoTouch.xml		Xamarin.Mac.xml		Xamarin.WatchOS.xml
Xamarin.Android.xml	Xamarin.TVOS.xml	Xamarin.iOS.xml

Compare this with Mono 4.2.2:

/Library/Frameworks/Mono.framework/Versions/4.2.2/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/SupportedFrameworks

MonoTouch.xml				Windows Store apps (Windows 8).xml
Windows 8.xml				Xamarin.Android.xml
Windows Phone 8.xml			Xamarin.Mac.xml
Windows Phone Silverlight 8.xml		Xamarin.iOS.xml
Comment 3 Alan McGovern 2016-02-01 11:23:16 UTC

*** This bug has been marked as a duplicate of bug 37767 ***