Xamarin forms failing ti install NotificationHub Nuget in UWP project - xamarin.forms

Trying this : https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started-push, using VS 2017 portable Xamarin Forms project. Except UWP all other projects including IOS , Android and Portable library are getting installed with the Notificaiton nuget package. In UWP its always failing with the below error message. Thanks for your help.
Package Microsoft.Azure.NotificationHubs 1.0.9 is not compatible with uap10.0.10240 (UAP,Version=v10.0.10240) / win10-x86-aot. Package Microsoft.Azure.NotificationHubs 1.0.9 supports: net45 (.NETFramework,Version=v4.5)

As of July 2016 Notification Hubs SDK is not available for UWP. The product team is aware of it and working on providing it.
At the moment, there are one way to workaround it:
Use WindowsAzure.Messaging.Managed Nuget package as described in Getting started with Notification Hubs for Windows Universal Platform Apps
Certain Hubs SDKs are open sourced. But, unfortunately, not Windows ones at the moment.

Related

using signalr client with xamarin forms

I am trying to install Microsoft.AspNetCore.SignalR.Client on Xamarin forms (on .net standard 2.0) and run the android app. I keep getting the error
Could not load assembly 'System.Threading.Tasks.Extensions' during startup registration
I have tried installing System.Threading.Tasks.Extensions nuget's latest prerelease, I still get the same error. I did not find any one else with this issue online.
You need Visual Studio 2017 Update 15.8 + Microsoft.AspNetCore.SignalR.Client Package with at least Version 1.0.1
ASP.NET Core 2.1.1 contains fixes to resolve blocking issues when
using the SignalR Client from Xamarin. However, these fixes also
require an updated build of Xamarin.iOS and Xamarin.Android, as
well as some additional dependencies.
In order to use the SignalR Client in Xamarin applications you will
need to:
Upgrade Microsoft.AspNetCore.SignalR.Client to 1.0.1.
Upgrade Xamarin to the appropriate version:
Xamarin.Android 8.4.0.1
VS2017 Update 15.8 comes with Xamarin.Android 9.0.x tools which contains the fix for the issue.

Using SQLite with Xamarin.Forms cross-platform project

I have used Visual Studio 2017 Community edition to create a plain vanilla cross platform PCL project, and would like to use SQLite. The only thing done to the project(s) was the use of Nuget to update all packages that needed updating.
Then, following the instructions on the Xamarin website at
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/databases/
I used Nuget to install sqlite-net-pcl,
It all seemed to work OK, except at the end the following error appears.
I presume the documentation is slightly dated. Should I change the target .NET framework. If so, to what?
As of v1.3 SQLite-Net-PCL is actually no longer a PCL, it is a .Net standard library.
You need to install version 1.2.0 of the NuGet package to use it inside a PCL - from the nuget package manager you can select a version so install v1.2.0 into all your projects.
The library above worked OK as a PCL library, but what I disliked was that the platforms were split out in to separate DLLs so you had a different dependency for each platform.
This library is for .NET Standard and only has a single DLL for all platforms:
https://github.com/MelbourneDeveloper/SQLite.Net.Standard
It does not support the ORM like functionality in the above library though.

Visual Studio for Mac and Xamarin Forms PCL - can't install NodaTime 2.0 with NuGet

I'd like to use NodaTime with Xamarin Forms in a PCL, however the NuGet install fails with this message:
Could not install package 'NodaTime 2.0.0'. 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.
The NuGet package information says it doesn't have any dependencies, what's up?
NodaTime 2.0.0 only supports .NET45 or .NET Standard. You either need to update your Xamarin Forms project to .NET Standard, or downgrade your NodaTime version 1.3.4.

I am developing iOS and Android app with Xamarin Forms in MAC. I am installing PCL Xamarin.Mobile, but i am getting error

The error i am getting while installing PCL. Any idea about below mentioned error?
Could not install package 'xamstore-xamarin.mobile 0.7.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.
From Xamarin Developer Matt Ward on the Xamarin Forums
The NuGet package xamstore-xamarin.mobile 0.7.1 only supports MonoAndroid and MonoTouch. It contains MSBuild property files for these two frameworks. You will not be able to install it into a Portable Class Library (PCL) project since it does not have any files that target any PCL framework.
Instead you should be able to add it to a Android or iOS project.
Similarly Xamarin.Mobile from the component store supports Android and iOS projects. It has assemblies for those platforms as well as for Windows Phone 7/8 and Windows 8 (WinRT). So you would be able to add that component into an Android or iOS project but not a PCL project.

Xamarin.Forms.Maps does not work with Mono Android, v2.2

I am trying to use Xamarin.Forms.Maps NuGet package for Xamarin.
But that is not supported to MonoAndroid, V2.2. This only supports MonoAndroid V1.0.
So how should I use Map in my project?
We just need to :
Right click on xxx.Droid project
Go to properties
Go to Application option
Change Compile using Android version from "Use Latest platform...." to "API Level XX"
Now try to install Nuget package
That works for me (y)

Resources