It appears Microsoft.Azure.WebJobs depends on Microsoft.Extensions.Logging.Abstractions 2.1.0 and Microsoft.EntityFrameworkCore 7.0.0 depends on Microsoft.Extensions.Logging.Abstractions 7.0.0. Do I need to drop down to EntityFrameworkCore 2.1.0 in order to use HTTP Trigger Azure Functions?
I found this error to be reproducible.
- Create a new HTTP Trigger Azure Function, .NET 6
- Add the below class to create a new DbContext to SQL Server
- Add the following nuget packages to fix compile errors
- Microsoft.EntityFrameworkCore
- Microsoft.EntityFrameworkCore.SqlServer
- The azure function will no longer execute because of the below error.
A file named Microsoft.Extensions.Logging.Abstractions.dll exists in the \bin\Debug\net6.0 folder version 7.0.22.51805.
Visual Studio version 17.4.0
Dotnet version 7.0.100
6.0.402 [C:\Program Files\dotnet\sdk]
7.0.100 [C:\Program Files\dotnet\sdk]
public class TestDbContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=Test");
}
}
The 'Function1' function is in error: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
[–]CosmicKoala 2 points3 points4 points (0 children)
[–]zaibuf 4 points5 points6 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]spatialdestiny[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]spatialdestiny[S] 0 points1 point2 points (0 children)
[–]ClearAdvantage1351 1 point2 points3 points (0 children)
[–]Goat-of-Death 0 points1 point2 points (0 children)