I have an AzureAD registered Web API working correctly. I am able to acquire the access token by means of AcquireTokenAsync. No problems there. However, no I need to downgrade my rest client library to .net 3.5. I am not being able to use ADAL in .net 3.5. AcquireTokenAsync returns a Task, which is not supported in 3.5. I have read in some tutorials that there is a non async verstion of the method (AcquireToken) here. But I just can't access that method. Also, when I try to install that specific version of ADAL(2.19.208020213) I get a Nuget error saying there is no version supported to .Net 3.5
What am I doing wrong?
UPDATE
I am trying to find out which version of ADAL targets .Net 3.5 so I can install it in my project.
UPDATE 2
If ADAL is not supported in .Net 3.5, what are my options to obtain authorization token from Azure AD in .net 3.5?
The library only supports 4.5 because async support was added in that .net release. You may need to dig back to very old versions of the library to get older .net sdk to work. But you would lose significant big fixes and features.
Related
I am converting a .NET Framework 4.7.1 class library to .NET Standard 2.0.
The library consumes a number of Nuget packages, all of which are available for both .NET Framework and .NET Standard and these packages include the WindowsAzure.Storage SDK.
The original .NET Framework class library compiles and runs correctly, but the .NET Standard library fails to compile, due to missing APIs (and some different method signatures) on the WindowsAzure.Storage SDK.
For example, CloudBlockBlob has a DeleteIfExists method in .NET Framework but not in .NET Standard.
The API documentation lists this method (and all the others that are broken in .NET Standard) but doesn't appear to mention any version differences between target frameworks. Did I miss something relevant here?
Is it normal that some .NET Standard Nuget packages have gaps in their APIs?
Is there a solution or a workaround for this (apart from re-writing the code that consumes these APIs)?
Thanks, in advance.
As per Peter Bons mentioned, In the nuget package WindowsAzure.Storage, there are only task based methods, so DeleteIfExistsAsync for .net core / .net standard.
Please use the new nuget package for azure storage. For blob storage, you can install Microsoft.Azure.Storage.Blob, version 9.4.0 or above, which does support sync / async methods.
The change log is here:
And here is a simple test with .net standard project with Microsoft.Azure.Storage.Blob, version 9.4.0 or above installed. Both sync / async methods are there.
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
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
According to Support and Retirement Information for the Azure SDK for .NET and APIs, SDK 2.6 introduced support for .NET 4.6. None of the listed SDKs explicitly mention 4.6.2 though the sister article Install .NET on a Cloud Service Role includes an installation script that explicitly installs .NET 4.6.2, implying that it is supported for web/worker roles.
When I attempted to upgrade my solution from .NET 4.5.1 (using Azure SDK 2.8) to .NET 4.6.2, I also modified my RoleProperties.txt file which included the following lines:
TargetFrameWorkVersion=v4.5.1
RoleTargetFramework=v4.5.1
to
TargetFrameWorkVersion=v4.6.2
RoleTargetFramework=v4.6.2
which resulted in the following error after calling cspack.exe:
Unsupported .Net Framework v4.6.2
I tried changing the 4.6.2 to simply 4.6 and that similarly failed.
So my questions are:
How do you correctly target .NET 4.6.2 using cspack.exe?
Is it necessary to set those properties to 4.6* or is it safe to leave them at 4.5.1 since cspack.exe doesn't complain?
I have a WPF application that targets framework v4.0 and uses async BCL. It seems that installing only .net framework v4.0 on fresh W7 OS is not enough, since as it seems, there was a bug which was corrected with later update. For example, installing update v4.0.3 solves the problem with using async BCL on framework v4.0.
My concern is this: On my developer machine (W8.1) I do not have this update installed (at least it is not registered in windows registry, nor under the windows updates). Still, my application is working just fine, which means that the update is somehow installed through some other method.
The question: how can I know that application that uses async BCL will work correctly on client's OS? Currently, when I install the application (wix 3.8), I check if .net 4.0 is installed, and I check if KB2600211 (4.0.3) is installed (by searching adequate registry keys). If not, I install them, but I am wondering if searching for KB2600211 is the right approach? Is there some other way to make sure that app will work correctly?
On your Windows 8.1 you have .NET 4.5.1 which is an in-place update for .NET 4.5 which is an in-place update for .NET 4.0. That means you no longer have plain .NET 4.0 (.NET 4.0.x, for that matter).
I recommend you to always test on the target environments. It can be as simple as having a VM.