When creating a new solution within Xamarian studio I get this error
Could not install package 'Xamarin.Forms 1.0.6186'. 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. For more information, contact the package author.
Is there a certain version of .Net that Xamarian Forms requires for it to be included in the solution? I've tried searching in their documentation but I'm only seeing marketing and not real in depth documentation.
I had a similar issue using Visual Studio and I've found that the following combination in the PCL works:
.NET Framework 4.5
Windows Phone Silverlight 8
Xamarin.Android
Xamarin.iOS
You have created the wrong project type, you created a normal Windows app, and I assume you are targeting iOS/Android or Mac.
Create the project with the correct type and it should work correctly.
If you are using Xamarin Studio for Windows (without also having Visual Studio installed) you need to download the Portable Library Tools. See the Xamarin doc Introduction to Portable Class Libraries.
I had the same problem with my Xamarin project. The problem was, that in the portable Xamarin project Windows Phone Silverlight was set as target. The PCL project from which I created the nuget, didn't reference Silverlight as target. I don't need Silverlight, so uninstalling all nuget packages from my portable Xamarin project, removing silverlight as target and reinstalling the NuGet packages solved it.
I had similar issue using VS and I found solution here - http://forums.xamarin.com/discussion/29674/xamarin-forms-dll-cannot-be-installed
"It looks like your NuGet Package Manager needs to be upgraded. The Xamarin PCL Profiles are installed but NuGet is not recognising Xamarin.iOS as a target framework. You can update NuGet by selecting Tools - Extensions and Updates, then select the Updates tab, then select Visual Studio Gallery. Then update NuGet from there."
I have invested a lot of time trying all the solutions posted here, but none of them helped me... Here is the solution that worked for me (on Windows 10):
1.) Open your .csproj file
2.) Find the TargetFrameworkProfile entry
3.) This entry contains Profile78 for me, therefore I open the folder below
c:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETPortable/v4.5/Profile/Profile78/SupportedFrameworks
4.a) If the folder does not exist, then use one of the solutions posted here to install the PLC right on your PC
4.b) Unfortunately, ASP.NET and Xamarin don't like each other, therefore delete all ASP profiles from this folder. For me it was ASP.NET Core 5.0.xml. Obviously this will break your ASP.NET support in VS
5.) Restart Xamarin and have fun!
interesting reading about all that:
https://forums.xamarin.com/discussion/52846/cannot-create-new-xamarin-forms-project-pcl-in-xamarin-studio-win10-vs2015
Related
I have the same error message as this question, causing my Xamarin Forms project to not deploy. This is because each platform target of my project (iOS, Android and the Shared Platform) is running different versions of Xamarin forms.
The answer in the linked question was:
Solution:
Change in your Core, Droid and IOS project the Xamarin.Forms versions. Make sure that all versions are the same.
How do I change my Xamarin.Forms versions for each of my target platforms? Here is what my navigation menu looks like:
Open your solution in VS expand the packages folder and right click your Xamarin.Forms package. Each .csproj in your .sln should be on the same version if not update update it to the version to match that or just update all of them to the latest XF.
It will look a bit different if you're on windows, which has the nice package manager, so in that case you can right click on your open solution and go to manage nuget packages for solution.
I am running into an issue when updating installed Nuget packages in my Xamarin.Android project. When running the updates, I get the following error:
Could not install package 'Xamarin.Android.Support.Animated.Vector.Drawable
27.0.2'. You are trying to install this package into a project that targets
'MonoAndroid,Version=v8.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.
A quick google search yielded several results with similar answers like the one found in this question. It seemed that I simply needed to make sure my Target Framework was set high enough.
Following the instructions found here I set out to change the Target Framework in Visual Studio 2017, however I found that it was already set to use 8.0.
Is there another step that I am missing in order to get these packages to update?
As Jon Douglas mentioned, API 27 actually requires Android 8.1. If you don't have the option to switch to 8.1 you will need to update Visual Studio. Once that is done, you should be able to install the 8.1 SDK via the Android SDK manager (Tools -> Android -> Android SDK Manager).
After the SDK is installed, you can set your Target Framework to 8.1 and update the Nuget packages.
you have to change your Mono.Android.dll Version to 8.1,
When I tried updating this library recently, I found there were some old lingering references in the csproj file, causing conflicts.
To resolve,
Unload the project (right click the project > Unload Project)
Open the csproj (right click the project > Edit xxx.csproj)
Remove all references to 'old' targets (for example, the whole reference tag to old libraries)
There may also be Import tags that need removing
On re-loading the project (right click > Reload Project), I was able to update that library.
In my case, I had Visual Studio 2017 with the most recent SDK version which included Android 8.1.
Even after changing all 3 Android target versions from the project properties to 8.1, the csproj was still showing a TargetFrameworkVersion of 7.1 as follows:
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
I manually changed that to 8.1
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
It will be interesting to find out if the minimum Android version still needs to be at 8.1 though.
and was then able to update the Nuget packages.
I have some problem with Visual studio Nuget.
I want to use Pechkin in my web project , but I cant find this package in Visual Studio Nuget Maneger.
I thought this have been remove , but it can be find on Nuget web.NuGet - Pechkin
Is my Visual Studio NuGet have some problem ? or I got some wrong step on this ?
How can I find Pechkin in my Nuget ?
(Can't found Pechkin 0.5.8.1 , Pechkin.Synchronized in NuGet , Just TuesPechkin and some else)
I have no problems with my Visual Studio do add this package. Check out the image:
I've found the package for a Windows Forms application. What type of application you are using? Maybe this package is not available to the type of application you want. There are packages that are available to a Windows Forms application, but not for a Mobile application, for example.
EDIT:
As this library is designed to work with .NET 4.0, you must ensure that your application targets the 4.0 .NET framework.
To check this, right-click on your project and go to Properties. You will see the Target Framework option. Set it to the .NET 4.0 option or above and test again to see if the package appears in NuGET.
I have tried adding the Signalr Client library and the WebApi client package to my Xamarin Solution (on Visual Studio with Xamarin Support and also on Xamarin Studio) but I always get this error although I am able to install other PCLs (for example Microsoft.Net.Http):
Could not install package 'Microsoft.AspNet.WebApi.Client 5.2.3'. You are trying to install this package into a project that targets 'portable-net45+sl50+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10', 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.
and the following error when adding Signalr:
Adding Microsoft.AspNet.SignalR.Client...
Adding 'Microsoft.AspNet.SignalR.Client 2.2.0' to Corda.Client.
Could not install package 'Microsoft.AspNet.SignalR.Client 2.2.0'. You are trying to install this package into a project that targets 'portable-net45+sl50+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10', 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 have also tried changing the the target framework with not success.
This is the build setting for my project:
and this is my C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile259\SupportedFrameworks folder:
I get the same errors on both Mac OSX and Windows 10. Any ideas?
Using Profile78 solved my problem. Full explaination here.
A simple workaround that worked with my Xamarin with VS:
Download the dll-files manually here: https://components.xamarin.com/gettingstarted/signalr/true
Import the following into your solution.
Microsoft.AspNet.SignalR.Client.dll
Newtonsoft.Json.dll
System.Net.Http.Extensions.dll
System.Net.Http.Primitives.dll
Done!
The problem is not with the dll-files, but with the (nuget) installer.
The problem is with the nuget package manager,specifically with the Windows Phone 8.1 project. I think it expects it to be a windows phone silverlight 8.1 project. There is a bug on installing signalr client on an universal 8.1 phone project in a xamarin project. It should be sorted out in the next xamarin release. Unselecting windows phone 8.1 in the portable config solves the issue,meaning you will have to take the windows phone 8.1 project out of the xamarin project and your need to create a universal windows 10 project.
Yes, As suggested by others this is the problem from nuget package manager, As per this link it should be fixed with the realease of Microsoft.signalr.client 2.2.1 version but for now if you still want to go with nuget, Add the below nuget source
https://www.myget.org/F/aspnetwebstacknightly/
to visual studio and install pre release version 2.2.1 pre-160523-b816 of the signalr client dll as suggested in below link
https://github.com/SignalR/SignalR/issues/3393
I created a Portable Class Library the other day in VS2013. It targeted the following platforms:
.NET Framework 4.5
Windows 8.1
Windows Phone 8.1 (non-Silverlight)
My question is, can this be used in Xamarin projects such as Xamarin.iOS or Xamarin.Android? I've found a project claiming to support Xamarin, but grepping the solution and project files for "ios" and "android" turn up nothing. If not, what can I do to make my library portable to those platforms?
Thanks.
You need to install Xamarin for Visual Studio first if you haven't already
Open your PCL project and change the target profile to include the Xamarin platforms you want to support. (e.g. Profile 78)
Optionally retarget all your dependencies (projects/nugets)
Recompile your PCLs
You should now have dlls that work also in Xamarin.
You'll have to make your project target those platforms and then recompile your .dlls in order to make them available for Android and iOS.
I don't know what is the edition of your Visual Studio, but the options to target Android/iOS should be available in VS2013. In any case, try downloading Visual Studio 2015 community (which is free), open your project using it and the option should be there.
If none of this works, you can also try manually changing your .csproj file to a different profile. This is stated to have worked on this answer.