.Net standard is not redirecting to latest version of Nuget package

Abhale, Sankalp 0 Reputation points
2023-05-07T16:36:10.2433333+00:00

Hello,
Currently I am using Azure.Core 1.30 in my project. This package has dependency on system.memory.data version 1.0.2. But I have installed latest version of system.memory.data which is version 6.0.0. When I am running application, it says system.memory.data not found.

Project is not redirecting to latest version of system.memory.data. .Net standard has no option to mention binding redirect in the project.

How to resolve this issue? Can you please help me?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,648 questions
{count} votes

2 answers

Sort by: Most helpful
  1. VasimTamboli 4,785 Reputation points
    2023-05-07T19:28:49.3433333+00:00
    This issue might occur due to the fact that Azure.Core version 1.30 is not compatible with System.Memory.Data version 6.0.0. You can try the following steps to resolve this issue:
    
    Uninstall the current version of System.Memory.Data from your project.
    
    Install the version of System.Memory.Data that is compatible with Azure.Core version 1.30. You can check the compatible versions in the NuGet package details for Azure.Core version 1.30.
    
    If the above steps do not work, you can try adding an assembly binding redirect in your app.config or web.config file. For .NET Standard projects, you can add the binding redirect in the .csproj file using the following code:
    
    xml
    Copy code
    <ItemGroup>
      <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
      <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.1" />
    </ItemGroup>
    
    <!-- Add the following section to redirect the System.Memory.Data assembly to the latest version -->
    <PropertyGroup>
      <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
      <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
    </PropertyGroup>
    This will automatically redirect the assembly to the latest version.
    
    If none of the above steps work, you can try manually updating the Azure.Core package to the latest version that is compatible with System.Memory.Data version 6.0.0.
    I hope this helps you resolve the issue.
    
    0 comments No comments

  2. Jiachen Li-MSFT 29,106 Reputation points Microsoft Vendor
    2023-05-08T05:36:06.69+00:00

    Hi, Welcome to Microsoft Q&A.

    If you install Azure.Core in Nuget Package Manager, it will auto install the reference packages.

    User's image

    You can alse choose to install System.Nemory.Data version 1.0.2 manually in Nuget Package Manager. User's image

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments