Forum Discussion
Migrating Azure Function from .NET 6 in-process to .NET 8 in-process Issues
I'm posting this to help anyone who will face this issue.
I'm migrating from .net6 in-process to .net8 in-process and I get this error whenever I try to run it
azure function app Could not load file or assembly 'System.Data.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
the fix I found is to add to app settings this line :
"FUNCTIONS_INPROC_NET8_ENABLED" : "1"
1 Reply
Resolution Steps:
To resolve this issue, the fix you applied by adding the following line to the application settings is correct:
"FUNCTIONS_INPROC_NET8_ENABLED" : "1"
This setting instructs the Azure Functions runtime to enable support for the .NET 8 in-process model, allowing it to load and run your .NET 8 code correctly. Without this setting, the function app might try to use an older version of the runtime, leading to compatibility issues like the one you encountered.
Steps to apply the fix:
- Go to your Azure Portal.
- Navigate to your Azure Function App.
- Under Configuration, find the Application settings section.
- Add the following key-value pair:
- Key: FUNCTIONS_INPROC_NET8_ENABLED
- Value: 1
- Save the changes and restart the Function App to apply the new setting.
Additional Notes:
- Ensure Dependencies Are Updated: Make sure that all your project dependencies (NuGet packages) are updated to versions that support .NET 8, including System.Data.Common if necessary.
- Function App Runtime Version: Ensure that your Azure Function App is using a runtime that supports .NET 8 in-process. You can verify this in the Function App settings under Runtime version.