How is ServiceStack support on Xamarin - c#

I would like to know how well ServiceStack supports client consumption and deserialization into objects on Xamarin for both iOS and Android as the official ServiceStack website does not mention this.

ServiceStack's released PCL client Libraries support in v4.06 which include support for both iOS and Android Xamarin platforms.
The Hello repository shows examples of using the libraries in all supported client platforms.
The PCL client libraries are maintained in the ServiceStack.Client NuGet package, e.g:
PM> Install-Package ServiceStack.Client

Related

How to use Iot.Device.Bindings nuget package on Windows uwp app?

I have Windows UWP foreground app running on my raspberry (windows 10 iot core). I want to use Iot.Device.Bindings nuget package to capture data from various sensors (e.g. bme680). But looks like this package is unsupported on UWP:
NU1202: Package Iot.Device.Bindings 1.2.0 is not compatible with uap10.0.17763 (UAP,Version=v10.0.17763). Package Iot.Device.Bindings 1.2.0 supports:
- net5.0 (.NETCoreApp,Version=v5.0)
I tried to create backroung job for iot core, but same error.
Can someone suggest approch how to achive that?
Thanks in advance!
Yes, the Iot.Device.Bindings package does not support UWP on Windows IoT Core but works for .net core. Since the library uses APIs in namespace System.Decive.. For UWP app, you need to use APIs in namespace Windows.Device.. At the moment, I can not find a package which is implemented for various sensors. Here are two suggestion for that:
Create a .net core app which uses the Iot.Device.Bindings nuget package, and build a channel to send the data from .net core app to your UWP app, such as tcp, or web API.
Imeplement the library for UWP by referring the source code.

GRPC C# Library For a Windows 8.1 Phone App

Is it possible to use GRPC C# library with a Windows Phone App? When I try to install GRPC through NuGet I receive the following error:
Error Could not install package 'Grpc.Core 1.0.0'. You are trying to install this package into a project that targets 'WindowsPhoneApp,Version=v8.1', 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. 0
Has anyone had any luck installing GRPC C# library for a windows phone app?
As of now, Windows Phone Apps are not supported by gRPC C#. Technically, supporting them would be possible but we are not sure it's worth the work at this point - we have different priorities (User experience, performance and supporting other platforms).
Here's a github issue that tracks the discussion: https://github.com/grpc/grpc/issues/7859

RabbitMQ in Xamarin

I'd would like to use RabbitMQ .I find nugget .NET but i get error :
You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.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.
How Can I implement connection with RabbitMQ . Manual copy source ?
The issue is that the RabbitMQ nuget package needs the full .NET Framework. Since PCLs and Xamarin Android projects don't provide the full framework, it won't work. One option is to take the source code and build it in a PCL like you suggested (eg see https://forums.xamarin.com/discussion/49858/using-rabbitmq-amqp-with-xamarin-forms). Depending on what you want to do, I think using the HTTP API might be worth considering too.
Rabbit MQ is now also built as a .net standard 1.5 libraries. https://www.nuget.org/packages/RabbitMQ.Client
You should be able to pull it into the latest Xamarin without any problems (taking into account that your xamarin build is set up to support version .net standard 1.5 or version 2.0).
Xamarin forms added support for standard libraries from version 2.3.5-pre
https://devblogs.microsoft.com/xamarin/building-xamarin-forms-apps-net-standard/
UWP is easily supported with .net standard 2.0 and is compatible with the 1.5 libraries.

Error when installing NetMQ via nuget to xamarin projects

I tried to install NetMQ to my xamarin application.
Because NetMQ depends on AsyncIO, this package could not be installed and show me 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.
How can I reesolve this issue?
The AsyncIO 0.1.18 NuGet package and the NetMQ 3.3.3.1 NuGet package only contain assemblies for .NET 4.0 and .NET 3.5 so you cannot install it into a portable class library project nor a Xamarin project.
Your options include:
Port those libraries to the Xamarin frameworks.
Only use these libraries on the server side. Your Xamarin project then connects to your server using a supported way, such sending json messages over http.
Find another library that does support the Xamarin frameworks.
NetMQ now target Xamarin IOS and Android, you can download here:
https://www.nuget.org/packages/NetMQ/4.0.0.3-rc3

HttpClient missing from .Net portable subset while creating PCL in Xamarin

I have created a Portable class library in Xamarin and want to use it for an android app. I want to use the HttpClient within this PCL. I have added the Microsoft Http Client libraries from the NuGet Package manager. I can now see the .Net portable subset added to my references. But somehow I still cannot use the HttpClient and it does not show in the .Net portable subset as well.
Also, my Current profile of the PCL is 4.0-Profile 158. If I change the profile to 4.5, Xamarin crashes and does not open the solution
Can anyone help me with this?
Thanks
The simple solution is to target .NET 4.5, Windows Store apps (Windows 8.1), Xamarin.iOS, and Xamarin.Android (4.5-Profile7). Then you won't need the HttpClient NuGet package to get those APIs.
If Xamarin is crashing when you try to select a 4.5 profile, please make sure you're using the latest version and then report the bug with details about how to repro it and what happens.
Also the HttpClient NuGet package should allow you to use HttpClient from PCL profile 158. Make sure you're using the latest version of NuGet. ".NET Portable Subset" should always appear in your references for a PCL, that's not related to the NuGet package. When you install the HttpClient NuGet package, you should also see references to System.Net.Http and other assemblies in your references.

Categories