I'm creating PCL library to be used at Windows Store 8.0 and Windows Phone 7.5 clients.
I created new PCL project and chose the following:
https://dl.dropboxusercontent.com/u/19503836/pcl_profile4.png
Selected profile covers .net 4.5 and silverlight 4.0 thus they were enabled automatically.
As a result I have Profile4 selected but when I'm trying to add Async nuget package to PCL project:
http://www.nuget.org/packages/Microsoft.Bcl.Async
I'm getting an error that this profile is not supported:
Attempting to resolve dependency 'Microsoft.Bcl (≥ 1.0.19)'.
Attempting to resolve dependency 'Microsoft.Bcl.Build (≥ 1.0.4)'.
'Microsoft.Bcl.Build 1.0.10' already installed.
'Microsoft.Bcl 1.0.19' already installed.
'Microsoft.Bcl.Async 1.0.16' already installed.
Adding 'Microsoft.Bcl.Build 1.0.10' to PortableClassLibrary1.
Could not install package 'Microsoft.Bcl.Build 1.0.10'. You are trying to install this package into a project that targets 'portable-win+net45+sl40+wp', 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.
How to create PCL library and add Async/Await support WITHOUT cheating the *.csproj file (I know I can specify profile there but I need to be able to it via UI for DEMO purposes).
Your project is targeting Windows Phone 7.0, not 7.1/7.5. Change your target to "Windows Phone 7.5 and higher".
For best results, uninstall all NuGet packages, change your targets, and then re-install your NuGet packages.
Related
Could not install package 'Xamarin.Kotlin.StdLib.Jdk8 1.6.10'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v11.0', but the package does not contain any assembly references or content files that are compatible with that framework.
You can fix that by targeting Android 12.
Change:
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
To:
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
This has to be done in all your Android projects, including Library projects.
Make sure your Xamarin.Android tooling is up to date, along with having API 32 installed in your Android SDK manager.
Also don't get fooled by the AndroidUseLatestPlatformSdk property if you do not have the correct SDK installed. It will just grab the latest you have installed and if that is lower than 12, you will still have the issue.
Also make sure to restore NuGet packages after this change.
I'm new to mobile development & Xamarin. I'm trying to install a 3rd party nuget package "BottomNavigationBar" to my portable project in Xamarin solution. But facing the below error while doing so.
Could not install package 'Xamarin.Android.Support.Compat 24.2.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', 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.
I'm having Xamarin.Forms version 2.3.4.247, with Android target framework "Android 7(Nougat)". And I have Android SDK installed with API 24.
Any help is appreciated.
As SushiHangover says this component targets Xamarin.Android only so it will be impossible to install in the PCL project.
You should use a similiar plugin that targets Xamarin.Form, this plugin is called: BottomNavigationBar.XF
You can see their source code here: https://github.com/thrive-now/BottomNavigationBarXF
I have created a Xamarin Forms project within VS 2017 Community Edition. I would like to use FluentMigrator to create a a database for use within the application.
When I attempt to use NuGet PM to install FluentMigrator into the project, I get the following error:
Could not install package 'FluentMigrator 1.6.2'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', 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.
I am guessing it's the fact that my project is using.NETPortable.
Is it possible to use FluentMigrator within a Xamarin PCL? If so, what needs to be changed in my project configuration?
The FluentMigrator does not have any assemblies that are compatible with PCL projects. It contains two lib directories: 35 and 40. These seem to have .NET assemblies for .NET 3.5 and .NET 4.0. So you cannot install this into a PCL project.
I would instead see if you can just create a .NET project, say targeting .NET 4.5, and install the FluentMigrator NuGet package into that project and define your migrations there.
Has anyone encountered this error when adding the Xamarin.Forms package through the "Add NuGet package" option?
PS I'm using Xamarin Studio and I only encounter this with Windows.
Error message is:
Could not install package 'Xamarin.Forms 2.2.0.31'. You are trying to
install this package into a project that targets
'.NETFramework,Version=v4.5,Profile=Profile78', but the package does
not contain any assembly references or content files that are
compatible with that framework.
Here is the screenshot
You are having a profile which has portable class Profile78.Profiles are the type of your portable class where you select the target projects which can use your PCL. The more you select the less functionality can be provided.
You need to change it to another one. Usually most classes (including Xamarin.Forms) are supporting Profile111. Profile111 is a profile which does not support Silverlight in contast du Profile78. So you need to go to Properties and deselect Windows Phone Silverlight and Silverlight. You can select everything else (.Net 4.5, Windows 8, Windows Phone 8.1, Android, iOS/iOS classic and ASP.NET Core 1).
Then try adding Xamarin.Forms again.
You can see more information with a list of all(?) profiles here.
Here you see how to change in Visual Studio project Properties:
And here in Xamarin Studio project Option:
The problem is that you do not have the Portable Class Library (PCL) profiles installed on Windows. Xamarin.Forms 2.2.0.31 supports Profile78 so changing it to Profile111 will not fix the problem.
The error message itself indicates that this is the problem since it refers to Profile78. If the NuGet package was really incompatible then NuGet would show the frameworks in the PCL profile in its error message not the profile number. If I try to install Xamarin.Forms 2.2.0.31 into a PCL project that targets Profile1 which is not supported by Xamarin.Forms then I get an error:
Could not install package 'Xamarin.Forms 2.2.0.31'. You are trying to install this package into a project that targets 'portable-net40+sl40+win+wp+Xbox40', 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.
Note that Profile1 is not mentioned.
There are detailed instructions on installing Portable Class Libraries for Xamarin Studio which I will summarize here:
To install the Portable Class Libraries on Windows you have three options:
Install Visual Studio 2013 (full or Express version). Update 2 or
above is required.
Install the Portable Library Tools and the Portable Library Reference Assemblies 4.6.
Install the Portable Library Tools and copy the .NETPortable directory from Mono over to Windows.
Following this tutorial I'm trying to install MvvmCross.HotTuna.MvvmCrossLibraries in Core project. The latest version of this library 'MvvmCross.HotTuna.MvvmCrossLibraries 4.0.0-beta3'.
After adding Nuget Package I have the following error:
Could not install package 'MvvmCross.HotTuna.MvvmCrossLibraries 4.0.0-beta3'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.0,Profile=Profile14', 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.
Does anyone know what the problem is?
Answer to original question:
MvvmCross is not available for ASP.NET. You need to use it in one of the compatible frameworks like UWP, Xamarin.Android, Xamarin.iOS or a PCL.
Updated Question:
MvvmCross uses at least .NET 4.5 with profile 259. Switch to those to be able to install the libraries.