Skip to content
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

.NET 8 In-proc App: Could not load file or assembly 'System.Memory.Data, Version=6.0.0.0, Culture=neutral' #10567

Closed
jsquire opened this issue Oct 24, 2024 · 3 comments
Assignees

Comments

@jsquire
Copy link
Member

jsquire commented Oct 24, 2024

Issue Transfer

This issue has been transferred from the Azure SDK for .NET repository, #46755.

Please be aware that @PauCoda is the author of the original issue and include them for any questions or replies.

Functions team:

This application is using the in-proc model with a net8.0 opt-in and referencing several Azure SDK packages as part of the function body. They're seeing a failure loading one of the 6.x line of packages. The Azure SDK team cannot reproduce this in a stand-alone application, as .NET assembly resolution hoists the dependency if a newer version is reference directly or as a transitive dependency. We have only been able to repro in an in-proc function app. and believe that its related to the host environment.

Your thoughts would be appreciated on potential steps to unblock.

Details

I'm hosting as an in-proc Azure Function and have "FUNCTIONS_INPROC_NET8_ENABLED": "1" in app settings. I'm running code from Azure.ResourceManager.Compute v1.6.0 and getting:

[2024-10-22T08:23:47.919Z] Could not load file or assembly 'System.Memory.Data, Version=6.0.0.0, Culture=neutral, PublicKeyToken=...'. 
The system cannot find the file specified.

Add all required libraries I use for my project:

<PackageReference Include="Azure.Core" Version="1.44.1" />
<PackageReference Include="Azure.Identity" Version="1.13.0" />
<PackageReference Include="Azure.ResourceManager" Version="1.13.0" />
<PackageReference Include="Azure.ResourceManager.Compute" Version="1.6.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.3.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />

Code can be found in the original issue in the Azure SDK repository.

Environment

Host:
Version: 8.0.10
Architecture: x64
Windows 10

.NET SDK:
Version: 8.0.110

@jviau
Copy link
Contributor

jviau commented Oct 30, 2024

Azure.Core/1.44.0 has a major version rev of a dependency: System.Memory.Data has gone from 1.0.2 to 6.0.0. The host controls loading of System.Memory.Data and only loads 1.0.2. Requesting 6.0.0 will fail with this exception.

The fix is to use Azure.Core < 1.44.0 and Azure.Identity < 1.13.0

@jsquire was that dependency major version rev intentional by the Azure.Core package?

@fabiocav
Copy link
Member

#duplicate of #10575

@jsquire
Copy link
Member Author

jsquire commented Oct 30, 2024

@jsquire was that dependency major version rev intentional by the Azure.Core package?

Yes. The Azure SDK packages are in the process of moving dependencies up to the 6.x range on the advice of the .NET team to get away from legacy packages where support is ending or with known bugs that will not be fixed.

From previous conversations with the Functions team, our understanding is that the in-process host running on net6.0 was bound to the 6.x line of dependencies and it was safe to consume them. If the host is bound to 1.0.2, then it would be subject to the same guidance that the Azure SDK package are and should strongly consider upgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants