Is Azure Notification Hubs package compatible with .NET Core?

我只是一个虾纸丫 提交于 2020-01-24 04:27:39

问题


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!


回答1:


[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.)



回答2:


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



来源:https://stackoverflow.com/questions/38313390/is-azure-notification-hubs-package-compatible-with-net-core

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!