I’m writing an Http triggered Azure Function v4 in .NET 4.8 with Microsoft.NET.Sdk.Functions 1.0.24
and my test endpoints that do not reference any other assemblies work correctly.
However, when I try to use a method in a referenced assembly, I get the following error:
Could not load type ‘System.Data.SqlClient.SqlParameter’ from assembly ‘System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.
at Example.Data.PeopleBiz.GetPersonByUserName(String username)
at Example.OperationFunc.DoItFunction.DoItEndpoint(HttpRequestMessage req, TraceWriter log)
I’m sorry I cannot post code due to confidentiality and the scale of the solution. I realize this probably restricts the assistance to people who have overcome this specific issue. Has anyone gotten a large .NET 4.8 Azure Function to work? Running locally in VS2022, this function works flawlessly.
Here are some relevant environment vars:
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~4",
"slotSetting": false
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet-isolated",
"slotSetting": false
}