From 2c3625943acc8e4a37473d86e725af7479a14ff3 Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Thu, 13 Apr 2023 21:20:34 -0700 Subject: [PATCH] Fix Microsoft.Extensions.Configuration deployment error (#183) The function app was failing with the error > Could not load file or assembly 'Microsoft.Extensions.Configuration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' This is true even though that DLL at that version was deployed with the function. The reason is that the function runtime is on .NET 6.0 and it loads several dependencies before it loads the function code. Anything loaded by the function runtime can't be overridden by the function app. In this case MS.E.Configuration was one of those extensions. More simply it was a mistake to use 7.0.0 here on a .NET 6 runtime, should've kept it at 6.0.1 from the start. --- DevOps.Functions/DevOps.Functions.csproj | 3 +-- DevOps.Functions/local.settings.json | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 DevOps.Functions/local.settings.json diff --git a/DevOps.Functions/DevOps.Functions.csproj b/DevOps.Functions/DevOps.Functions.csproj index 8ee19e1..13bcabf 100644 --- a/DevOps.Functions/DevOps.Functions.csproj +++ b/DevOps.Functions/DevOps.Functions.csproj @@ -8,8 +8,7 @@ - - + diff --git a/DevOps.Functions/local.settings.json b/DevOps.Functions/local.settings.json new file mode 100644 index 0000000..bcefcb2 --- /dev/null +++ b/DevOps.Functions/local.settings.json @@ -0,0 +1,7 @@ +{ + "IsEncrypted": false, + "Values": { + "AzureWebJobsStorage": "UseDevelopmentStorage=true", + "AzureWebJobsDashboard": "UseDevelopmentStorage=true" + } +} \ No newline at end of file