I'm trying to add MvvmCross-SecureStorage plugin of MvvmCross to PCL wich contains classes shared between Universal Widows app iOs apps and Android apps, but I'm getting this kind of error.
Could not install package 'Beezy.MvvmCross.Plugins.SecureStorage 1.0.0'. You are trying to install this package into a project that targets 'portable-net45+win+wpa81+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.
Anybody successfully added this plugin to PCL?
Looking at https://github.com/ChristianRuiz/MvvmCross-SecureStorage it looks like this project doesn't yet support the new unified xamarinios10 target which is included in your list.
One route forwards would be to add unified support to that open source project and to send them a Pull Request.
Related
I'm new in Xamarin, Xamarin.Forms and C# platform.
I'm starting the development of an app that should support Android and iOS devices. I'm using a PCL project for code sharing. Currently this project is using the profile111 because Visual Studio has selected it by default for me. But when I try to install some NuGet packages I'm getting a message saying the package is not compatible. Something like:
Could not install package 'DocsBrStandard 2.0.1'. You are trying to
install this package into a project that targets
'.NETPortable,Version=v4.5,Profile=Profile111', but the package does
not contain any assembly references or content files that are
compatible with that framework.
I believe this message is related with the profile I'm using, right?
So which profile should I use for my app that should support only iOS and Android devices? Is profile111 the more appropriate for this scenario?
At least, how can I identify if a package is compatible or not with my Xamarin.Forms app?
Thanks.
You need to target .NET Standard to be able to use the DocsBrStandard package. So you can't work with profile based PCL if you want to use that package.
Check out this article about targeting .NET Standard with Xamarin.Forms:
https://blog.xamarin.com/building-xamarin-forms-apps-net-standard/
I'm making an iOS/Android app that will work with Azure IoT Hub. The latest Microsoft.Azure.Devices version from what I understand is only compatible with .Net Standard projects. I've been trying to follow these twho tutorials (1, 2) to convert PCL project to .Net Standard project to no avail, and I'm lost on what I'm doing wrong.
These are the steps that I'm taking.
Create new Cross Platform App called TestProject. Xamarin.Forms -> Blank App -> Portable Class Library (PCL)
Right click solution -> Add New Project -> .Net Standard -> Create .Net Standard Library called TestProject.Core
Delete the auto generated class Class1.cs and move App.xaml and MainPage.xaml to TestProject.Core.
Delete Portable Library TestProject.
Rename TestProject.Core to TestProject.
Add TestProject reference to iOS and Android.
Click on TestProject and select Edit TestProject.csproj. Change PropertyGroup to following:
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<PackageTargetFallback>$(PackageTargetFallback);portable-win+net45+wp8+win81+wpa8
</PropertyGroup>
Right click on solution and select Manage Nuget Packages For Solution.
Check Include Prerelease and install 2.3.5.256-pre6 Xamarin.Forms on TestProject, TestProject.Droid and TestProject.iOS.
Clean and Rebuild solution.
Right click on TestProject and select Manage Nuget Packages. Install Microsft.Azure.Devices
Clean and Rebuild.
Add code to TestProject that uses Microsoft.Azure.Devices.
Rebuild and get error:
Project File Line Suppression State Error Exception while loading assemblies: System.IO.FileNotFoundException:
Could not load assembly 'Microsoft.Azure.Devices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Perhaps it doesn't exist in the Mono for Android profile? File name: 'Microsoft.Azure.Devices.dll'
From what I can understand I am missing Microsoft.Azure.Devices Nuget package on
TestProject.Droid, however, when I attempt to install it, I get the following error:
Could not install package 'System.Threading.Overlapped 4.3.0'.
You are trying to install this package into a project that targets
'MonoAndroid,Version=v7.1', but the package does not contain any assembly references or
content files that are compatible with that framework.
When I try to install *Microsoft.Azure.Devices** on iOS:
Could not install package 'System.Threading.Overlapped 4.3.0'. You are trying to install
this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not
contain any assembly references or content files that are compatible with that framework.
I'm making an iOS/Android app that will work with Azure IoT Hub. The latest Microsoft.Azure.Devices version from what I understand is only compatible with .Net Standard projects.
Per my understanding, you could leverage the Azure IoT Hub client SDK portable library Microsoft.Azure.Devices.Client.PCL which supports Android, iOS, Windows 10 (UWP) and Windows Phone (WinRT). Also, here is a sample uses Microsoft.Azure.Devices.Client.PCL, you could follow here.
I'm working on a mail service and I can't seem to reference System.Net.Mail or MailKit. I'm left with this error trying download a nuget package for my PCL project reference. What seems to be the alternative way to fix this? I was advised to use Office365 outlook services but I dont know how to use it?
Could not install package 'Mail.dll 3.0.16292.1158'. You are trying to
install this package into a project that targets
'.NETPortable,Version=v4.5,Profile=Profile7', 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 Portable Class Library or .NETPortable means that the library depends on just a limited set of functionality from the system that it runs on, in order to make it cross platform compatible.
The packages that you tried to install were not built for that (they need more base functionality) and so they can't be used with your project.
If you need to stay PCL compliant then you could try MimeKit - purely based on the fact that their page has a section for 'Portable Class Library'; never used it personally.
When trying to install the netmq vis nuget, I get the following error:
Could not install package 'AsyncIO 0.1.18'. You are trying to install this package
into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111',
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.
The problem is that netmq depends on AsyncIO. when installing it, nuget find that the assembly is not compatible with .Net 4.5.
so nuget fail in installing AsyncIO, and then failed in installing netmq.
So I downloaded the AsyncIO Source from Github and build it locally with .Net 4.5.
After that and added the dll of AsyncIO built locally as a reference for my project.
Theoretically, NetMQ should be successfully installed with nuget. because I added the needed reference to AsyncIO.
But when trying to reinstall NetMQ, I get the same error:
Could not install package 'AsyncIO 0.1.18'. You are trying to install this package
into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111',
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 nuget did not detect that I added 'AsyncIO 0.1.18' in my project.
How to let nuget detect that I added this reference in my project?
Have a look here:
.NET Portable profiles
Profile111 is a combination of:
.NET Framework 4.5
Windows 8.0
Windows Phone 8.1
or in other words:
portable-net45+netcore45+wpa81
So your project into which you are trying to append the NuGet targets Windows Phone 8.1 and other 2 platforms, I mention this one as the most restrictive.
Now let's have a look at the named NuGet package's source:
<ProjectGuid>{3830B7A3-0225-4FDA-B155-E085E183650C}</ProjectGuid>
<OutputType>Library</OutputType>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
What do we have here? We can see that the project is not a PCL. It is targeting full .NET 4.0 framework which is not available on Windows Phone 8.1. And your library does target Windows Phone 8.1. See the problem?
You say that if you compile the AsyncIO targeting .NET 4.5 than you can successfully append it into your project as a reference? That's not altogether true. I mean you can append a reference to it but you cannot use it. You will see that when you try to call something from that reference.
In order to use AsyncIO from you PCL will have to build AsyncIO as a PCL targeting the same or more restrictive set of platforms. Try creating a PCL project targeting Profile111 and try compiling the AsyncIO code with it (just link the original AsyncIO source files (*.cs) into this new AsyncIO_PCL project). If you are lucky enough and the code of AsyncIO is really compatible you will be able to use that library.
Here are your steps:
Create a new project (named AsyncIO_PCL) of type PCL class library.
Pick the Profile111 platform set i.e.
.NET Framework 4.5
Windows 8.0
Windows Phone 8.1
Link all the .cs files from the original AsyncIO project save one (AssemblyInfo.cs) into the new AsyncIO_PCL project.
Set the output assembly name to the same as in original AsyncIO project.
Try building the project.
Your ability to build the AsyncIO as a PCL with the required set of supported platforms depends on AsyncIO code i.e. which API is used inside and if that API is supported by all the three platforms you are targeting.
Try clicking right-button on the project -> Properties. In the "Application" menu check the "Target Framework". It should be set to .NET Framework 4.5
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