-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Microsoft.Azure.NotificationHubs Version=4.2.0 #316
Comments
Hi @SanandABB, Thanks for reaching out. I'm working on repro'ing this bug independently. Can you give me more information about the version of .NET that you're using to host the Azure Functions instance where you are seeing this issue? As an aside, I've confirmed that using ILSpy, only the major version of the dependency is being rendered. So despite having 6.0.1, ILSpy still reports 6.0.0.0. |
+ Ioana
From: Martin Strobel ***@***.***>
Sent: 25 April 2024 02:43 AM
To: Azure/azure-notificationhubs-dotnet ***@***.***>
Cc: Sanand IV ***@***.***>; Mention ***@***.***>
Subject: Re: [Azure/azure-notificationhubs-dotnet] [BUG] Microsoft.Azure.NotificationHubs Version=4.2.0 (Issue #316)
BeSecure!
This email comes from outside of ABB. Make sure you verify the sender before clicking any links or downloading/opening attachments.
If this email looks suspicious, report it by clicking 'Report Phishing' button in Outlook or raising a ticket on MyIS.
Hi @SanandABB<https://urldefense.com/v3/__https:/github.com/SanandABB__;!!NLW3fF9v!MyGj5kKRhy30l3J-GLM63IVO_NxR8le7xJ7ADxn7Bou2-8MLgM4h9ltbwZSRXaH4ryqirp-Ljtk7uq5w5RMahWQw$>,
Thanks for reaching out. I'm working on repro'ing this bug independently. Can you give me more information about the version of .NET that you're using to host the Azure Functions instance where you are seeing this issue?
As an aside, I've confirmed that using ILSpy, only the major version of the dependency is being rendered. So despite having 6.0.1, ILSpy still reports 6.0.0.0.
-
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/Azure/azure-notificationhubs-dotnet/issues/316*issuecomment-2075853601__;Iw!!NLW3fF9v!MyGj5kKRhy30l3J-GLM63IVO_NxR8le7xJ7ADxn7Bou2-8MLgM4h9ltbwZSRXaH4ryqirp-Ljtk7uq5w5Z2eTnX5$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/BHYXZQEACVUA5E2YNUAKYJDY7AN43AVCNFSM6AAAAABGEAQKNOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZVHA2TGNRQGE__;!!NLW3fF9v!MyGj5kKRhy30l3J-GLM63IVO_NxR8le7xJ7ADxn7Bou2-8MLgM4h9ltbwZSRXaH4ryqirp-Ljtk7uq5w5fAQQWZM$>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
I have the similar issue and find out that it may be related to "assembly binding redirect" in App.config or Web.config to map the version from 6.0.0.0 to 6.0.0.1. If the bindingRedirect is manually removed, the Error "Could not load file or assembly 'Microsoft.Extensions.Caching.Memory, Version=6.0.0.0" will throw. Usually the bindingRedirect is generated automatically. But in some rare cases it can't. For example, Not sure if it is the same case of @SanandABB. My fix is to uninstall both "Microsoft.Azure.NotificationHubs" and "Microsoft.Extensions.Caching.Memory" in NuGet and then install back the NotificationHubs. Then confirm the bindingRedirect is exist in Web.config or App.config. <configuration>
...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Caching.Memory" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> |
I'm also getting the same issue and I did tried @austinlau solution but didnt work. |
I have same issue, I had clean project, reinstall nuget, but not woking. |
Howdy folks - I've accepted a new role and am no longer working on the ANH product. I'm going to unassign myself, but I'll send some emails internally to get this issue attention. |
Hi @SanandABB ! Hope all is well. It is possible that the issue could be related to your Azure Functions configuration. I have found some other examples of similar dependency resolution errors involving Azure Functions on StackOverflow - [here is an example of such an issue]. (https://stackoverflow.com/questions/64809716/could-not-load-file-or-assembly-microsoft-extensions-configuration-abstractions) One possible workaround seems to be updating the Azure Function version to v4. Would that be something you could try and report back the results? Thanks! |
You can solve Azure NH 4.2.0 working by having all the Microsoft.Extensions.* packages to 6.0.0. Here is my packages.config (.NET Framework 4.8 project).
For this, you need to force to install Microsoft.Extensions.Caching.Memory to 6.0.0.
|
These possible solutions mentioned above haven't worked for me. I'm unable to ignore dependencies in NuGet Package Manager. Planning to update Azure Function to version 4 but any other ways to fix this issue would be of great help. |
The most upvoted suggestions are to downgrade Microsoft.Extensions.* to a 3.1.X version. When I attempt to do so, It also wants me to downgrade the Microsoft.Azure.NotificationHubs version to 4.1.0 which I do not want to do. Other suggestions on this thread have not helped me out either. Not sure if anyone else as another work around idea. I am a bit lost on this one. |
Describe the bug
We are getting errors while trying to update the Microsoft.Azure.NotificationHubs' Version='4.2.0'.
According to NuGet Gallery | Microsoft.Azure.NotificationHubs 4.2.0 the dependency in .NETStandard 2.1 is for package
Microsoft.Extensions.Caching.Memory with version (greater or = 6.0.1) but at runtime version 6.0.0 is expected.
Exception or Stack Trace
Error Message:
System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'Microsoft.Extensions.Caching.Memory, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
Source=Microsoft.Azure.NotificationHubs
StackTrace:
at Microsoft.Azure.NotificationHubs.Auth.TokenProvider..ctor(Boolean cacheTokens, TimeSpan cacheExpirationTime)
at Microsoft.Azure.NotificationHubs.Auth.TokenProvider..ctor(TimeSpan cacheExpirationTime)
at Microsoft.Azure.NotificationHubs.Auth.SharedAccessSignatureTokenProvider..ctor(String connectionString)
at Microsoft.Azure.NotificationHubs.Auth.SharedAccessSignatureTokenProvider.CreateSharedAccessSignatureTokenProvider(String connectionString)
at Microsoft.Azure.NotificationHubs.NotificationHubClient..ctor(String connectionString, String notificationHubPath, NotificationHubSettings settings)
at Microsoft.Azure.NotificationHubs.NotificationHubClient..ctor(String connectionString, String notificationHubPath)
at Microsoft.Azure.NotificationHubs.NotificationHubClient.CreateClientFromConnectionString(String connectionString, String notificationHubPath)
To Reproduce
Step 1 - Update Microsoft.Azure.NotificationHubs to Version=4.2.0 in Azure function version 3.
Step 2 - Update Microsoft.Extensions.Caching.Memory to version 6.0.1 in the same Azure function
Step 3 - Call the following method available in Microsoft.Azure.NotificationHubs: NotificationHubClient.CreateClientFromConnectionString(azureNotificationHubConnectionString, azureNotificationHubName).
Code Snippet
notificationHub = NotificationHubClient.CreateClientFromConnectionString(azureNotificationHubConnectionString, azureNotificationHubName);
Expected behavior
Notification hub client instance created; No dependency to Microsoft.Extensions.Caching.Memory to version 6.0.0
Screenshots
Setup (please complete the following information):
Visual Studio 2019
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: