Azure Notification Hubs with .NetCore 2.0 - azure

we have recently migrated to .NetCore 2.0 and so far I can say it went quite smoothly. However it seems that today we have stumbled upon the first hurdle. NotificationHubClient seems to require .NetFramework 4.5. We've tried installing NotificationHubClient nuget package but have been getting a series of exceptions, the latest was the missing library Systems.Diagnostics.Eventlog.
Is there a plan to release a fully .NetCore 2.0 compatible version of Azure NotificationHubClient? #azure-notificationhubs

We've been working on supporting .netcore for Notification Hubs, and this should be available in the next few weeks.
Thank you,
Karl

Related

.NET Core 2.1 Azure Functions won't build in Azure Pipelines

I keep getting this error when I try to run the pipelines for my azure backend functions:
[error]C:\Users\VssAdministrator.nuget\packages\microsoft.net.sdk.functions\1.0.27\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(41,5): Error : It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.1.0' was not found.
It's a pretty old program, but yesterday was the first time that the build has failed and I don't know how to fix it. It happens both in the develop and main branch so I'm guessing it's a change from Azure.
As documented in this GitHub issue .NET Core 2.1 has been removed from all build agent images.
Possible impact
If your project depends on a pre-installed .Net 2.1 it can be broken.
You can try to use the setup dotnet task to explicitly install .NET Core 2.1.
- uses: actions/setup-dotnet#v1
with:
dotnet-version: '2.1.x'
Please be advised .NET Core 2.1 has been out of support since August 21, 2021 (see .NET and .NET Core Support Policy). An upgrade to a currently supported version like .NET Core 3.1 or higher should not be a lot of work and is well worth the effort.

Azure App Services: assembly specified in application dependencies manifest (Microsoft.AspNetCore.AzureAppServices.HostingStartup.deps.json) not found

I have a .net core 2.1 application that is hosted on Microsoft Azure App Service.
It worked for a couple of years and hasn't been updated in the last year.
But it stop with error in stdout:
Error:
An assembly specified in the application dependencies manifest (Microsoft.AspNetCore.AzureAppServices.HostingStartup.deps.json) was not found:
package: 'Microsoft.AspNetCore.AzureAppServices.HostingStartup', version: '2.2.0'
path: 'lib/netcoreapp2.1/Microsoft.AspNetCore.AzureAppServices.HostingStartup.dll'
Also it still works well in IIS in a virtual machine.
I've got the similar issue yesterday.
After digging up into this and hadn't found solution, I've created support ticket to Microsoft.
They provided the following recommendations:
Publish with:
<PublishWithAspNetCoreTargetManifest>False</PublishWithAspNetCoreTargetManifest>
Upgrade to .NET Core 2.2
These steps helped me and application returned back to online.
Looks like they stopped support of .NET Core 2.1 version on their Azure App Services. Check this link for detalis:
https://devblogs.microsoft.com/dotnet/net-core-2-1-will-reach-end-of-support-on-august-21-2021/
PS: As far as I can tell, .NET Core 2.2 might be gone soon too. So I'm focusing to move my application to .NET Core 3.1 shortly.

Application Insights doesn't work if you have Microsoft.Azure.ServiceBus Nuget package installed

We have an e-commerce ASP .NET MVC application which posts a message in an Azure Service Bus Queue at some point. To interact with the Azure Service Bus we are using Microsoft.Azure.ServiceBus v5.0 package.
Application is hosted in Azure as a WebApp so we are using Application Insights to monitor it but because of the fact that Microsoft.Azure.ServiceBus starting with the version 3.0 has a dependency on System.Diagnostics.DiagnosticSource monitoring is failing (basically nothing is logged to Application Insights).
We found out that this is an known issue:
Troubleshooting Application Insights Agent (formerly named Status Monitor v2)
The question is there are other solutions than downgrade Microsoft.Azure.ServiceBus package to version 2?
Thanks.
As I understand your question correctly, it asks about how to handle this situation where the two nugets have conflicting version requirements for a common child (System.Diagnostics.DiagnosticSource) nuget.
In such cases, you should always use a version of one of the former nugets which has the version of the child nuget version lower as compared to the other. For example, in this case you should use below two compatible nuget packages:

Azure MobileServiceClient can InsertAsync but not ReadAsync

I can create a MobileServiceClient and GetTable<Model>() to InsertAsync, and see how my model gets inserted in the Easy Table table in Azure. But when I ReadAsync() from the table I get the following error:
Microsoft.WindowsAzure.MobileSerices.MobileServiceInvalidOperation: The server did not provide a response with the expected content.
This is when I mobileServiceClient.GetTable<Model>.ReadAsync()
What could be the problem?
This was when running from an MsTest project with no Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init(); call. The read worked when running the app
I had the same problem.
According to GitHub Issue:
As #elamalani pointed out above, we don't support .Net Core 2.1 in the SDK today. Unfortunately, we don't have a workaround today and like Ela said, the we don't have an ETA for a new release or other SDK to use for .Net Core 2.1 compatibility yet, so your only workaround is to stick with .Net Core 2.0 for now.
And I was also had SDK version 2.1
After changing SDK to version 2.0 all going to work fine. Please try to making the same, hope it will help you

Is Microsoft.Azure.NotificationHubs 1.0.9 compatible with .NET Core 2.0?

We are using NotificationHubs version 1.0.9 with .NetCore 2.0 and .Net Framework 4.7.
At compile time, we get this warning:
"Package Microsoft.Azure.NOtificationHubs 1.0.9 was restored using '.NETFramework, version=4.6.1' instead of the project target framework '.NETCoreApp, version=2.0. this package may not be fully compatible with your project."
Everything is still built, but at runtime when this call is invoked:
RegistrationDescription hubRegistration = await hubClient.CreateAppleNativeRegistrationAsync(device.DeviceToken); //hubClient is NotificationHubClient
We get this error:
Has anyone encountered this before and have any idea how to fix it?
At compile time, see this warning: "Package Microsoft.Azure.NOtificationHubs 1.0.9 was restored using '.NETFramework, version=4.6.1' instead of the project target framework '.NETCoreApp, version=2.0. this package may not be fully compatible with your project."
The Microsoft.Azure.NotificationHubs package requires .Net Framework 4.5 Full Profile. And here is a feedback Microsoft.Azure.NotificationHubs add support for .NET CORE.
AFAIK, if you create the ASP.NET Core Web Application with the target framework at .NetCore 1.0 or .NetCore 1.1, you could edit your *.csproj and change the TargetFramework to net461, then you could install and use Microsoft.Azure.NotificationHubs 1.0.9.
While for .NetCore 2.0 MVC, after you create the project, it would reference the Microsoft.AspNetCore.All 2.0.0, and this package supports netcoreapp2.0. I assumed that you could leverage Notification Hubs REST APIs and follow the git sample azure-notifications Send REST to access your notification hub for a workaround.
A preview version of a .NET Standard compatible NuGet is now available. It will allow using Notification Hubs with .NET core.
According to a Microsoft Product Manager a new version of the .NET SDK supporting .NET Core will be deployed very soon.
cf this question
But no mention on Feedback Microsoft site. I would recommend to vote for this feature

Resources