Is Azure Notification Hubs package compatible with .NET Core? - c#

I'm working with a .NET core app, and I see some Azure packages are not compatible, for example NotificationHubs and SendGrid:
Package Microsoft.Azure.NotificationHubs 1.0.5 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0)
The dependency SendGrid.CSharp.HTTP.Client 2.0.4 does not support framework .NETCoreApp, Version=v1.0
I only tried adding NotificationHubs and SendGrid. I haven't even tried any ActiveDirectory packages yet.
Does anyone have any idea if some of these packages will be compatible soon? Or maybe I'm doing something wrong? Or is there a way in a .NET core app to reference an older package?
Thanks!

[Update 11/30/2017] Microsoft.Azure.NotificationHubs 2.0.0-preview1 compatible with .NET Core has just been published.
[Original answer] As of mid-July 2016 Azure Notification Hubs SDK is not available for .NET core. The product team is working on it, but there's no ETA yet.
At the moment, there are two ways to work around it:
Use WindowsAzure.Messaging.Managed Nuget package as described in Getting started with Notification Hubs for Windows Universal Platform Apps
Through REST APIs. (List of methods.)

If you are working on Azure, you are not required to use netcoreapp to use ASP.NET Core. You can still use ASP.NET Core with the Full Framework by targetting net461 instead of netcoreapp1.0 and it will still work, Azure has the Full Framework available and they are both compatible with the same version of NetStandard.
We have several Web Apps that run on netcoreapp1.0 and others on net461 due to package dependencies (like Azure SDKs), and all run on ASP.NET Core.
When the product team start releasing the .Net Core App compatible packages, just re-target netcoreapp1.0 and add the Microsoft.NETCore.App package and it will keep working.
Sample github repo of an Azure Web App using ASP.Net Core with Full Framework

Related

Avoiding non-crossplatform dependencies in .Net Standard

I'm porting the existing library from .Net Framework 4.7.2 to .Net Standard 2.0 to make it cross-platform but still retain compatibility with .Net Framework apps.
I do not understand how to avoid non-cross-platform dependencies.
My library uses dynamic types and Settings.Designer.cs.
To support it in .Net Standard, I have to add a reference to Microsoft.CSharp and System.Configuration.ConfigurationManager NuGet packages, which in turn adds dependencies to some other packages like System.Security.Principal.Windows, even though I don't use any security-related code.
The last two are clearly part of Microsoft.Windows.Compatibility package.
How to find out, if these dependencies are cross-platform or not (i.e. part of Windows Platform Extensions)?
When I go to .NET API Browser I see that Microsoft.Csharp is not in .Net Standard 2.0, however it is in .Net Platform Extensions 2.1 and further. Does it mean, that this package is not cross-platform? Are there any other services to check platform support for NuGet packages?
When I created a simple test app on .Net Core 2.1 that uses my library and published it to a Linux platform with dotnet publish -c Release --self-contained true --runtime linux-x64, the app actually works fine on Linux machine. Does it mean, that my lib is fully cross-platform and I can safely use it in production, or I may still encounter System.PlatformNotSupportedException on Linux in the future?

Do .NET Core SDK / Runtime and NuGet Package Versions have to match?

I currently have a ASP.NET Core Application running on ASP.NET Core 3.1.2.
While looking for package updates, i realized, that a lot of Microsoft packages (e.g. Microsoft.Extensions.Caching.Memory, Microsoft.Extensions.Configuration.Abstractions, ...) have been updated from 3.1.2 (the latest version available when i built the application) to 3.1.5. Also the latest .NET Core SDK and Runtime has been updated to 3.1.5.
Is this a coincidence or is there any connection between .NET Core SDK / Runtime and NuGet package versions?
Also can i update my NuGet packages to 3.1.5 without updating the .NET Core Runtime on my server?
Thanks,
Jens
Generally they don't have to match, unless some reflection that requires some exact version of some assembly (which happens to ASP.NET Core very often).
Due to the semantic versioning of .NET Core platform and packages, updates in the third version must bring no API changes, so they will always build without failure and regular calls to these packages would work properly.

Microsoft TeamFoundationServer ExtendedClient Not compatible with Asp.Net Core 3

This package is not compatible with Asp.Net Core 3 web api. Only .net framework :/.
Quick describe:
I am working on an custom web api project with asp.net core 3.0. The goal is to connect with TFS 2013 to create/update/event listener work items.
I was trying to install :
Microsoft.TeamFoundationServer.ExtendedClient -Version 16.153.0
I prompt me with the following waring
Warning NU1701 Package 'Microsoft.AspNet.WebApi.Core 5.2.3' was
restored using '.NETFramework,Version=v4.6.1,
.NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7,
.NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2,
.NETFramework,Version=v4.8' instead of the project target framework
'.NETCoreApp,Version=v3.0'.
This package may not be fully compatible with your project.
I even posted in their site. Any workaround this ?(switch to .NETFramework is out of the list)
Thanks
The TeamFoundationServer.ExtendedClient package you are trying to use includes support for the older SOAP object model that is now end-of-line. Microsoft will not update this package any longer. As such it is very unlikely there will ever be official support for .NET Core.
Assuming your desired functionality can be realized with the modern REST API's, consider switching to one (or more) of modern REST-based packages documented at https://learn.microsoft.com/en-us/azure/devops/integrate/concepts/dotnet-client-libraries?view=azure-devops .
These are all NetStandard 2.0 and should work fine in your Core application.
As an alternative, you could call the REST API directly. It's a bit less convenient, but definitely feasible.
Package Microsoft.TeamFoundationServer.ExtendedClient doesn't support very well for .Net Core framework. Since you want to work with TFS 2013, it's suggested to use .Net framework instead of .Net Core framework.
LOL !
source:
Microsoft.TeamFoundationServer.ExtendedClient package doesn't have NetStandard support

Cannot install EntityFramework 6.1.3 on my Web API .Net Core Project

I want to ask for help on how to install EntityFramework on my web api project (.net core).
I tried installing it but it keeps showing the error "Package restore failed. Rolling back packages.."
Is EntityFramework compatible on web api?
Thanks in advance for your response. Have a good day!
If you run a .Net Core Mvc project which is the combine Web Api and Mvc for Core the package Microsoft.AspNetCore.All, which you most likely already have installed, already include this.
The docs says
To add EF Core support to a project, install the database provider
that you want to target. This tutorial uses SQL Server, and the
provider package is Microsoft.EntityFrameworkCore.SqlServer. This
package is included in the Microsoft.AspNetCore.All metapackage, so
you don't have to install it.

Microsoft.azure.devices.client version for .net core 1.1

I have a .Net 4.5.2 project that works with Azure IoT hub. I'm trying to use the same code in a .Net core 1.1 (or Core 1.0) project but the package is not compatible. Is there another package that provides the same device support?
Really comes down to DeviceClient type as in:
static DeviceClient deviceClient;
I could place the code in a 4.5.2 class library and try that.
Anyone have a full .net core device implementation?
We just published a new version of the device client SDK that is .Net Standard 1.3
You should now be able to use it in a .Net Core project.
Update the Nuget Package to latest version and try again.

Categories