Xamarin Error: Framework not installed: .NETPortable, Version=v4.5

10,265

Solution 1

If you don't have Visual Studio installed the following steps worked for me:

  1. Download the Portable Tools 2 extension and install it using the /buildmachine switch: PortableLibraryTools.exe /buildmachine

  2. Download Portable Class Libraries v4.6 and install it.

  3. Copy the contents (directories v4.0, v4.5 and v4.6) of C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6 into C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable (overwriting any existing files). [Backup the original files if you want to be on the safe side!]

Solution 2

That looks like you do not have the Portable Class Libraries installed on your machine.

Xamarin does not currently install the PCLs for you on Windows. Normally they are installed with Visual Studio but they are available as a separate download.

The PCLs are installed in the following directory on Windows:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable

Check if you have that directory. If you do not have this directory you will need to install the Portable Class Library Tools first and then the Portable Class Libraries v4.6.

I suspect you may just be missing the v4.6 PCLs.

Profile78 is included as part of Portable Class Libraries v4.6. If you install that it puts a .zip file into the directory:

C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6

You will need to unzip that and extract the contents into the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable directory.

Share:
10,265
Russ960
Author by

Russ960

Experience data professional working with SQL Server, BigQuery, MySQL and MongoDB.

Updated on June 04, 2022

Comments

  • Russ960
    Russ960 about 2 years

    I installed Xamarin successfully and create a new project. With no code at all I'm getting the following error under the references and get errors that Xamarin.Forms is missing. I tried searching and I'm not seeing this same error where the fixes suggested work. Thank you.

    Error:

    Framework not installed: .NETPortable, Version=v4.5
    

    System Setup:

    Windows 7 (Build 7601: Service Pack 1)

    Xamarin Studio 5.1.4 (Build 0)

    Visual Studio 11.0.50727.1 RTMREL Ultimate

    .NET Framework Version 4.5.50709

    Tried to start project from VisualStudio got the following error: enter image description here

    So I tried something else by starting as Administrator and this this output:

    Adding Xamarin.Forms...
    Installing 'Xamarin.Forms 1.0.6186'.
    Added file 'Xamarin.Forms.Build.Tasks.dll' to folder 'Xamarin.Forms.1.0.6186\build\portable-win+net45+wp80+MonoAndroid10+MonoTouch10'.
    Added file 'Xamarin.Forms.targets' to folder 'Xamarin.Forms.1.0.6186\build\portable-win+net45+wp80+MonoAndroid10+MonoTouch10'.
    Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.1.0.6186\lib\MonoAndroid10'.
    Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.1.0.6186\lib\MonoAndroid10'.
    Added file 'Xamarin.Forms.Platform.Android.dll' to folder 'Xamarin.Forms.1.0.6186\lib\MonoAndroid10'.
    Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.1.0.6186\lib\MonoAndroid10'.
    Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.1.0.6186\lib\MonoAndroid10'.
    Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.1.0.6186\lib\MonoTouch10'.
    Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.1.0.6186\lib\MonoTouch10'.
    Added file 'Xamarin.Forms.Platform.iOS.dll' to folder 'Xamarin.Forms.1.0.6186\lib\MonoTouch10'.
    Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.1.0.6186\lib\MonoTouch10'.
    Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.1.0.6186\lib\MonoTouch10'.
    Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.1.0.6186\lib\portable-win+net45+wp80+MonoAndroid10+MonoTouch10'.
    Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.1.0.6186\lib\portable-win+net45+wp80+MonoAndroid10+MonoTouch10'.
    Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.1.0.6186\lib\portable-win+net45+wp80+MonoAndroid10+MonoTouch10'.
    Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.1.0.6186\lib\portable-win+net45+wp80+MonoAndroid10+MonoTouch10'.
    Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.1.0.6186\lib\WP80'.
    Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.1.0.6186\lib\WP80'.
    Added file 'Xamarin.Forms.Platform.WP8.dll' to folder 'Xamarin.Forms.1.0.6186\lib\WP80'.
    Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.1.0.6186\lib\WP80'.
    Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.1.0.6186\lib\WP80'.
    Added file 'Xamarin.Forms.1.0.6186.nupkg' to folder 'Xamarin.Forms.1.0.6186'.
    Successfully installed 'Xamarin.Forms 1.0.6186'.
    Adding 'Xamarin.Forms 1.0.6186' to Test.
    Could not install package 'Xamarin.Forms 1.0.6186'. You are trying to install this package into a project that targets 'portable-Profile78', 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.
    
  • Russ960
    Russ960 almost 10 years
    I have the Portable Class Libraries v4.6 installed. I think its because I'm using the starter edition license. I was able to do this by using android project rather than Xamarin.Forms portable or shared.
  • Matt Ward
    Matt Ward almost 10 years
    It looks like you are missing Profile78 based on the error message. Check if this directory is available C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Pro‌​file78\SupportedFram‌​eworks and contains any .xml files. The error is from NuGet and if you have Profile78 installed it should show the frameworks for that profile and not the profile name in the error message.
  • Matt Ward
    Matt Ward almost 10 years
    I have only got the starter edition. In Visual Studio I can create a project from the Blank App (Xamarin.Forms Portable) project template. You get a few messages about having the wrong license however the projects are created. The Android and iOS projects are greyed out afterwards. The PCL project is created and Xamarin.Forms NuGet package is installed.
  • Russ960
    Russ960 almost 10 years
    Not sure why I have these. Portable Library Tools 2 cannot be installed unless you are running 2010 VS. I do have the Portable Class Libraries v4.6 installed. Not sure what I'm doing wrong.
  • Russ960
    Russ960 almost 10 years
    I added comments. I think there is a problem loading the package.
  • Matt Ward
    Matt Ward almost 10 years
    Portable Library Tools 2 can be installed using the /buildmachine option if you do not have Visual Studio 2010 installed. However I would probably not do that if you have PCL installed already. The error message still seems to indicate that it is not finding Profile78 on your machine. If I install a NuGet package such as Ninject into a PCL project it fails with You are trying to install this package into a project that targets 'portable-net45+wp80+win+MonoAndroid10+MonoTouch10'. If I remove Profile78 I get the same error as you are seeing.
  • Matt Ward
    Matt Ward almost 10 years
    You could try this console app to see what PCLs you have on your machine - github.com/mrward/mono-portable-class-library-util
  • IKnowledge
    IKnowledge over 9 years
    What if you have Visual Studio Installed?
  • Niels R.
    Niels R. over 9 years
    @Ilya.N. Which version?
  • Nicolás Arias
    Nicolás Arias about 9 years
    Worked fine for me after restarting Xamarin Studio.
  • Lucas Locatelli
    Lucas Locatelli about 6 years
    Adding here if want to compile .NETPortable using visual studio build tools 2017 follow the same steps and voila!