Skip to content

Commit

Permalink
Fix Microsoft.Extensions.Configuration deployment error (#183)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jared Parsons committed Apr 14, 2023
1 parent 4a79e6a commit 2c36259
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions DevOps.Functions/DevOps.Functions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.1.1" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DevOps.Util.DotNet\DevOps.Util.DotNet.csproj" />
Expand Down
7 changes: 7 additions & 0 deletions DevOps.Functions/local.settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureWebJobsDashboard": "UseDevelopmentStorage=true"
}
}

0 comments on commit 2c36259

Please sign in to comment.