Closed stimms closed 7 months ago
https://github.com/Azure/azure-functions-host/issues/6893#issuecomment-726386105
Consequence: if you need a library that is a direct or indirect dependency of azure functions you can only use the version that is loaded. This is a case where azure functions is incorrectly reporting its hard dependencies.
eg: if you are using azure functions 3.0.7, then you must use a library binary compatible with logging.abstractions 2.1.0 When your code (eg if you have a asp.netcore dependencency) asks for something that is only found in Abstractions >=5.0 the runtime (correctly) responds "sorry, that function isn't there", because all it has is the 2.1.0 dll in memory.
Therefore the many tickets that will be raised that are like this can only be solved by upgrading azure functions to a newer version which has a dependency on the 5.x line of the abstractions.
In this particular case, if azure functions used Microsoft.Extensions.Logging.Abstractions 5.0, then it would be fine because that library appears to be backwards compatible so the reverse error doesn't occur (no runtime failure if you expect 2.1 and actually get 5.0).
If that is not true for all libraries in common between azure functions and the libraries your code uses, then you will be pinned in terms of your dependencies and azure functions versions.
Closing as answered/stale.
Creating a new functions project and installing
Microsoft.EntityFramworkCore.Cosmos
results in a project that is unable to run due to problems withMicrosoft.Extensions.Logging.Abstractions
.Investigative information
Azure Functions Core Tools Core Tools Version: 3.0.2996 Commit hash: c54cdc36323e9543ba11fb61dd107616e9022bba Function Runtime Version: 3.0.14916.0
It has been reported in other issues that adding
To the project file helps solve some overly aggressive binary cleaning. However adding this simply moves the problem and we now get
Project file now looks like
Updating functions to 3.0.11 does not address this problem nor does moving to .NET 5.
Repro steps
Microsoft.EntityFrameworkCore.Cosmos
Expected behavior
Project will run and accept Http traffic (for the default http function)
Actual behavior
Everything is broken and things are awful.
Known workarounds
Downgrade to the 3.1.10 version of
Microsoft.EntityFramworkCore.Cosmos