Xamarin in Visual Studio cannot add xamarin.forms from Nuget - c#

I downloaded the xamarin.form project from github. But when I build the project it is missing the xamarin.forms package.
I tried adding it with Nuget but got this error:
Installing 'Xamarin.Forms 1.3.3.6323'.
Successfully installed 'Xamarin.Forms 1.3.3.6323'.
Adding 'Xamarin.Forms 1.3.3.6323' to DialogPro.
Uninstalling 'Xamarin.Forms 1.3.3.6323'.
Successfully uninstalled 'Xamarin.Forms 1.3.3.6323'.
Install failed. Rolling back...
Could not install package 'Xamarin.Forms 1.3.3.6323'. You are trying to install this package into a project that targets 'portable- net45+sl50+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.##
How can it fix it? Please help me! Thanks.

It looks like you are targeting the wrong profile. You don't have windows phone but you do have silverlight. Do you need silverlight? I know that it definitely works with Profile 78 or 259. Adjust your targets and then try to add the nuget package again. Unfortunately, this means you probably should re-add all of your nugets for that package since the target changed.
edit:
Here's a good article on some of the xamarin supported profiles: http://danrigby.com/2014/04/16/xamarin-pcl-profile-notes/. I forgot that silver light is included. If you open the project in Xamarin Studio, it actually tells you the profile number. Open the csproj in a text editor and see if the profile number is listed at the top.

It sounds like you are adding Xamarin.Forms to a project that doesn't target any of the required frameworks.
You only need to add Xamarin forms package to your android, iOS, WinPhone and PCL projects.

Related

Emgu error when trying to install emgu.CV.runtime.windows in VC# 2017

I'm trying to install emgu.CV.runtime.windows from within Visual Studio 2017, and installing by the recommeded method of right-clicking references and installing via NuGet.
However I am getting the error below.
Could not install package 'Emgu.runtime.windows.msvc.rt.x64 19.28.29336'. You are trying to install this package into a project that targets .NETFramework,Version=v4.7.2, 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.
According to the package information, its dependencies are
enter code here.NetStandardVersion=2.0
enter code here.Engu.CV (> 4.5.1 && < 4.5.2)
enter code here.Engu.runtime.windows.msvc.rt.x86 (= 19.28.29336)
enter code here.Engu.runtime.windows.msvc.rt.x64 (= 19.28.29336)
I checked and c:\windows\Microsoft.NET\Framework contains a folder for v2.0.50727, so it seem .net 2.0 is installed (as is v3.0, v3.5, v4.0.30319)
I have emgu.CV 4.5.1.4349 installed.
I need this library so that I can have the enter code herebitmap.ToImage<Bgr, byte>(); function.
Why am I getting this error?
Any help would be greatly appreciated.
The solution is migrating from package.config to package references for every project you have. Simply right click on package.config and click "migrate package.config to PackageReference".
Then, install the runtime package again and it will work.
For the new Emgu Nuget package you do need to use PackageReference instead of the traditional package.config.
What worked for me on Visual Studio 2017:
Uninstall all NuGet Packages [This removes the package.config file]
Go to Tools --> Options --> NuGet Package Manager --> General
Change the default package management format to "PackageReference"
Check "allow format selection on first package install"
Click OK
Install Emgu.CV, Emgu.CV.Bitmap, Emgu.CV.UI and Emgu.CV.runtime.windows
These Emgu packages should now appear under your references and you should not see a package.config file.
Nuget Options Image
I encountered the same error. I don't know why we're getting it, but I was able to find a workaround.
Visit the nuget page for the package.
Click "Download Package" to download the nuget package directly.
Open the downloaded file using your archive utility of choice and navigate to the "\runtimes\win-x64\native" folder.
Copy both dll files into the output directory of your project.
After doing this, my code executed without error. Make sure to install emgu.CV.Bitmap as well.
I changed my projects Target Framework to ".NET Framework 4.6" and then went to "Manage NuGet Packages", selected "Browse", typed in "emgu.cv.runtime" then installed version 4.5.1.4349 and it worked.
Here is how I solved it,
1- downgrade .Net framework to 4.6 from project properties
2- Uninstall Emgu.CV and related ones (you will see which ones needed to be uninstalled in Errors List)
3- Install Emgu.CV.runtime.windows from Solution Nuget Manager ( it should install fine now)
3- upgrade .Net framework to 4.8
4- install Emgu.CV 4.5.1 (latest)
5- install Emgu.CV.UI 4.5.1 (Emgu.CV.Bitmwp was installed automatically for me)
and that's it, now you can use bitmap.ToImage<Bgr,Byte>(), note that the Image<Bgr,byte>(bitmap) doesn't work anymore.

Xamarin cannot install package System.Security.Principal.Windows 4.3.0 MonoAndroid,Version=v7.1

I Have tried install MySql.Data but for each time I have error about the package does not contain any references etc. That same problem I have got when I was trying install updates Xamarin.Android.Support. I changed in project properties Android Version but still not working.
You need to change 'Target Framework' in 'Build -> General' section to at least Android 7.1

Xamarin can not install NuGet packages: profile 259 error

I am developing a cross-platform Xamarin app. When I install new packages using the NuGet package manager, the console shows this error:
Could not install package 'X' You are trying to install this package
into a project that the target .NetPortable, Version=4.5, Profile=259
but the package does not contains any assembly references
I know that Profile 259 is generally used for WP or Silverlight based packages. I tried to change configurations on the Properties → Library → Change tab, but this time the system shows:
Project target cannot to be changed.The selected target require
nuget 3.0
How can I solve this problem?
Here's the image of the last error message dialog.
If you look at the NuGet definition for this item:
https://www.nuget.org/packages/Microsoft.AspNet.WebApi.WebHost/
It only supports net45. Thus it cannot install into Profile259.
To be able to install to Profile259 it would need to have a target framework of portable-net45+win8+wpa81+wp8 or netstandard1.0.

Cannot add the Signalr Client library as a portable library to a Xamarin project

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

Monogames can't add SharpDx Dll

Yo,
I have follow this tuto step by step : http://developer.nokia.com/Community/Wiki/XNA_Games_On_Windows_Phone_8_with_Monogame
But still not working.
errors message : Warning 8 The referenced component 'SharpDX' could not be found. MonoGame.Framework.WindowsPhone
or
Warning 4 The referenced component 'SharpDX.WP8' could not be found. MonoGame.Framework.WindowsPhone
i have deduce SharpDx was missing (obvious), but when i try to add the reference using Nuggetsmanagepacket; I have the following message :
Installing 'SharpDX 2.5.0'.
Successfully installed 'SharpDX 2.5.0'.
Adding 'SharpDX 2.5.0' to MonoGame.Framework.WindowsPhone.
Uninstalling 'SharpDX 2.5.0'.
Successfully uninstalled 'SharpDX 2.5.0'.
Install failed. Rolling back...
Could not install package 'SharpDX 2.5.0'. You are trying to install this package into a project that targets 'WindowsPhone,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.
Any Idea about what the problem, no awnser on Wiki_nokia website.
I have WP8 Sdk, and i'm using full version of Visual studio express 2012 (on Windows 8 )
Unfortunately nuget packages don't support platform specific builds of SharpDX. You need to add all references manually.

Categories

Resources