2
votes

I have a funny error where NuGet will not work in Portable Class Library projects. I have created a portable class library project and when I attempt to search (through the NuGet dialog) or install (through the console) I get the following error:

Specified argument was out of the range of valid values. Parameter name: supportedFrameworks

enter image description here

I had this error with all projects (Class, etc.) in VS2012 but I followed this advice and it has fixed it except for PCL projects. In a class project the NuGet dialog will list packages and install them just not in PCLs.

What is wrong and how can I fix this?

Note: I am creating a Xamarin Cross Platform project in VS2012 (ie the project is a PCL solution). Maybe this is the cause error - Xamarin's VS Extensions? I am also using VS2012 Professional Trial version - could this be the issue?

Edit Maybe I dont have my PCL setup? For example I dont have the folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile.

1

1 Answers

1
votes

As far as I know Visual Studio 2012 does not include any Portable Class Libraries. They are installed with Visual Studio 2013. Otherwise you will have to install them yourself which involves several steps.

  1. Install the Portable Library Tools and the Portable Library Reference Assemblies 4.6.
  2. Extract the PCLs from the .zip file that the Portable Library Reference Assemblies 4.6 installs into C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6.
  3. Copy the PCLs extracted into C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable.
  4. Repair the Xamarin install so it adds its PCL profile xml files to the new PCL directories.