How to fix System.IO.FileNotFoundException exception caused by a missing System.Memory.Data.dll in the bin folder

Chandran, Ajith 0 Reputation points
2024-10-22T05:05:47.63+00:00

I am experiencing this issue across all my Azure Function apps after a recent NuGet update to SDK v8.0.403. All of these function apps are using the In-Process model.

I have updated all my NuGet packages, including Microsoft.Azure.WebJobs.Extensions.ServiceBus to v5.16.4, which has a transitive dependency on the System.Memory.Data package.

Exception: Could not load file or assembly 'System.Memory.Data, Version=6.0.0.0, Culture=neutral, PublicKeyToken='. The system cannot find the file specified.

Source: System.Private.CoreLib

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,118 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,922 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 4,610 Reputation points Microsoft Employee
    2024-10-23T08:36:56.25+00:00

    Hello @Chandran, Ajith

    This issue is caused by a recent NuGet update to SDK v8.0.403. To fix this issue, you need to add a reference to the System.Memory.Data package in your project. You mentioned that you have already updated all your NuGet packages, including Microsoft.Azure.WebJobs.Extensions.ServiceBus to v5.16.4, which has a transitive dependency on the System.Memory.Data package.

    However, it seems that the System.Memory.Data.dll is still missing from your bin folder. To resolve this issue, you can try the following 5 steps:

    1. Open your project in Visual Studio.
    2. Right-click on your project in the Solution Explorer and select "Manage NuGet Packages".
    3. In the "Browse" tab, search for "System.Memory.Data" and install the latest version of the package.
    4. Build your project and check if the System.Memory.Data.dll is now present in the bin folder. If the above steps do not resolve the issue, you can try manually adding a reference to the System.Memory.Data.dll in your project.
    5. To do this, follow these 4 steps:
    6. Right-click on your project in the Solution Explorer and select "Add Reference".
      1. In the "Reference Manager" dialog, select "Browse" and navigate to the location of the System.Memory.Data.dll file.
      2. Select the System.Memory.Data.dll file and click "Add".
      3. Build your project and check if the System.Memory.Data.dll is now present in the bin folder.

    I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.