Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0 #2304

Closed
fvalencia12 opened this issue Nov 19, 2020 · 51 comments
Labels
Milestone

Comments

@fvalencia12
Copy link

fvalencia12 commented Nov 19, 2020

I have an Azure Function that is deployed and has been working for a while. I just made some more changes and upgraded some nuget packages and suddenly while debugging locally I started getting some errors while running the function. The error I get is:
[2020-11-19T20:37:35.407Z] A host error has occurred during startup operation '24d5b302-c1ac-4501-ae05-88204ffe8ba3'.
[2020-11-19T20:37:35.408Z] System.Private.CoreLib: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
Value cannot be null. (Parameter 'provider')

I tried to rollback my changes and after rolling back many changes I made I cannot get the function app to run in my local machine. I have not tried to deploy as I need the app in Azure to work for now.

Below is my function app and the common project setup. I have spent two days trying to get this back to a running state and have no luck. I have a feeling that something got updated and some reflection operation is not happy with something, just not sure what.

I have tried adding the Microsoft.Extensions.Logging.Abstractions package to both my function app and common library and have had no luck with this.

Any help would be greatly appreciated as I really ran into a dead end on this.

Regards
Fabian

This is my tooling information:
Azure Functions Core Tools
Core Tools Version: 3.0.2996 Commit hash: c54cdc3
Function Runtime Version: 3.0.14916.0

image

image

In case it helps, this is the verbose version of the console output:

[2020-11-19T21:50:25.327Z] Building host: startup suppressed: 'False', configuration suppressed: 'False', startup operation id: 'f0e7565a-5f40-4e51-a172-b1f53f9e7ece'
[2020-11-19T21:50:25.358Z] Reading host configuration file 'C:\Users\fv2\source\repos\DataLakeFunctions\DataLakeSize\bin\Debug\netcoreapp3.1\host.json'
[2020-11-19T21:50:25.361Z] Host configuration file read:
[2020-11-19T21:50:25.362Z] {
[2020-11-19T21:50:25.362Z] "version": "2.0",
[2020-11-19T21:50:25.362Z] "logging": {
[2020-11-19T21:50:25.363Z] "applicationInsights": {
[2020-11-19T21:50:25.363Z] "samplingExcludedTypes": "Request",
[2020-11-19T21:50:25.364Z] "samplingSettings": {
[2020-11-19T21:50:25.364Z] "isEnabled": true
[2020-11-19T21:50:25.364Z] }
[2020-11-19T21:50:25.365Z] }
[2020-11-19T21:50:25.365Z] }
[2020-11-19T21:50:25.366Z] }
[2020-11-19T21:50:25.383Z] Loading functions metadata
[2020-11-19T21:50:25.385Z] Reading functions metadata
[2020-11-19T21:50:25.397Z] 5 functions found
[2020-11-19T21:50:25.408Z] 5 functions loaded
[2020-11-19T21:50:25.411Z] Loading extensions from C:\Users\fv2\source\repos\DataLakeFunctions\DataLakeSize\bin\Debug\netcoreapp3.1\bin. BundleConfigured: False, PrecompiledFunctionApp: False, LegacyBundle: False
[2020-11-19T21:50:25.415Z] Loading startup extension 'DurableTask'
[2020-11-19T21:50:25.510Z] Loaded extension 'DurableTask' (2.0.0.0)
[2020-11-19T21:50:25.554Z] Reading host configuration file 'C:\Users\fv2\source\repos\DataLakeFunctions\DataLakeSize\bin\Debug\netcoreapp3.1\host.json'
[2020-11-19T21:50:25.556Z] Host configuration file read:
[2020-11-19T21:50:25.557Z] {
[2020-11-19T21:50:25.557Z] "version": "2.0",
[2020-11-19T21:50:25.557Z] "logging": {
[2020-11-19T21:50:25.558Z] "applicationInsights": {
[2020-11-19T21:50:25.558Z] "samplingExcludedTypes": "Request",
[2020-11-19T21:50:25.559Z] "samplingSettings": {
[2020-11-19T21:50:25.559Z] "isEnabled": true
[2020-11-19T21:50:25.559Z] }
[2020-11-19T21:50:25.560Z] }
[2020-11-19T21:50:25.560Z] }
[2020-11-19T21:50:25.561Z] }
[2020-11-19T21:50:26.080Z] Initializing Warmup Extension.
[2020-11-19T21:50:26.396Z] Durable extension configuration loaded: {"httpSettings":{"defaultAsyncRequestSleepTimeMilliseconds":30000},"hubName":"TestHubName","storageProvider":{"connectionStringName":null,"controlQueueBatchSize":32,"partitionCount":4,"controlQueueBufferThreshold":256,"controlQueueVisibilityTimeout":"00:05:00","workItemQueueVisibilityTimeout":"00:05:00","trackingStoreConnectionStringName":null,"trackingStoreNamePrefix":null,"fetchLargeMessagesAutomatically":true,"maxQueuePollingInterval":"00:00:30","useLegacyPartitionManagement":false},"tracing":{"traceInputsAndOutputs":false,"allowVerboseLinuxTelemetry":false,"traceReplayEvents":false},"notifications":{"eventGrid":null},"maxConcurrentActivityFunctions":80,"maxConcurrentOrchestratorFunctions":80,"notificationUrl":"http://localhost:7071/runtime/webhooks/durabletask","localRpcEndpointEnabled":null,"extendedSessionsEnabled":false,"extendedSessionIdleTimeoutInSeconds":30,"maxOrchestrationActions":100000,"overridableExistingInstanceStates":"NonRunningStates","entityMessageReorderWindowInMinutes":30,"useGracefulShutdown":false,"rollbackEntityOperationsOnExceptions":true,"useAppLease":true,"appLeaseOptions":{"renewInterval":"00:00:25","acquireInterval":"00:05:00","leaseInterval":"00:01:00"}}. HubName: TestHubName. AppName: . SlotName: . ExtensionVersion: 2.3.1.
[2020-11-19T21:50:26.446Z] Initializing Host. OperationId: 'f0e7565a-5f40-4e51-a172-b1f53f9e7ece'.
[2020-11-19T21:50:26.454Z] Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=f0e7565a-5f40-4e51-a172-b1f53f9e7ece
[2020-11-19T21:50:26.473Z] LoggerFilterOptions
[2020-11-19T21:50:26.473Z] {
[2020-11-19T21:50:26.475Z] "MinLevel": "None",
[2020-11-19T21:50:26.475Z] "Rules": [
[2020-11-19T21:50:26.477Z] {
[2020-11-19T21:50:26.477Z] "ProviderName": null,
[2020-11-19T21:50:26.479Z] "CategoryName": null,
[2020-11-19T21:50:26.479Z] "LogLevel": null,
[2020-11-19T21:50:26.480Z] "Filter": "b__0"
[2020-11-19T21:50:26.481Z] },
[2020-11-19T21:50:26.489Z] {
[2020-11-19T21:50:26.490Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2020-11-19T21:50:26.490Z] "CategoryName": null,
[2020-11-19T21:50:26.491Z] "LogLevel": "None",
[2020-11-19T21:50:26.492Z] "Filter": null
[2020-11-19T21:50:26.494Z] },
[2020-11-19T21:50:26.500Z] {
[2020-11-19T21:50:26.501Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2020-11-19T21:50:26.504Z] "CategoryName": null,
[2020-11-19T21:50:26.510Z] "LogLevel": null,
[2020-11-19T21:50:26.513Z] "Filter": "b__0"
[2020-11-19T21:50:26.521Z] },
[2020-11-19T21:50:26.532Z] {
[2020-11-19T21:50:26.536Z] "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2020-11-19T21:50:26.546Z] "CategoryName": null,
[2020-11-19T21:50:26.547Z] "LogLevel": null,
[2020-11-19T21:50:26.555Z] "Filter": "b__0"
[2020-11-19T21:50:26.557Z] }
[2020-11-19T21:50:26.565Z] ]
[2020-11-19T21:50:26.565Z] }
[2020-11-19T21:50:26.573Z] LoggerFilterOptions
[2020-11-19T21:50:26.575Z] {
[2020-11-19T21:50:26.583Z] "MinLevel": "None",
[2020-11-19T21:50:26.594Z] "Rules": [
[2020-11-19T21:50:26.595Z] {
[2020-11-19T21:50:26.602Z] "ProviderName": null,
[2020-11-19T21:50:26.605Z] "CategoryName": null,
[2020-11-19T21:50:26.611Z] "LogLevel": null,
[2020-11-19T21:50:26.614Z] "Filter": "b__0"
[2020-11-19T21:50:26.620Z] },
[2020-11-19T21:50:26.624Z] {
[2020-11-19T21:50:26.633Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2020-11-19T21:50:26.635Z] "CategoryName": null,
[2020-11-19T21:50:26.636Z] "LogLevel": "None",
[2020-11-19T21:50:26.644Z] "Filter": null
[2020-11-19T21:50:26.651Z] },
[2020-11-19T21:50:26.654Z] {
[2020-11-19T21:50:26.654Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2020-11-19T21:50:26.664Z] "CategoryName": null,
[2020-11-19T21:50:26.673Z] "LogLevel": null,
[2020-11-19T21:50:26.674Z] "Filter": "b__0"
[2020-11-19T21:50:26.681Z] },
[2020-11-19T21:50:26.684Z] {
[2020-11-19T21:50:26.684Z] "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2020-11-19T21:50:26.694Z] "CategoryName": null,
[2020-11-19T21:50:26.701Z] "LogLevel": null,
[2020-11-19T21:50:26.704Z] "Filter": "b__0"
[2020-11-19T21:50:26.712Z] }
[2020-11-19T21:50:26.715Z] ]
[2020-11-19T21:50:26.721Z] }
[2020-11-19T21:50:26.726Z] FunctionResultAggregatorOptions
[2020-11-19T21:50:26.734Z] {
[2020-11-19T21:50:26.736Z] "BatchSize": 1000,
[2020-11-19T21:50:26.744Z] "FlushTimeout": "00:00:30",
[2020-11-19T21:50:26.746Z] "IsEnabled": true
[2020-11-19T21:50:26.753Z] }
[2020-11-19T21:50:26.755Z] SingletonOptions
[2020-11-19T21:50:26.763Z] {
[2020-11-19T21:50:26.766Z] "LockPeriod": "00:00:15",
[2020-11-19T21:50:26.773Z] "ListenerLockPeriod": "00:00:15",
[2020-11-19T21:50:26.776Z] "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
[2020-11-19T21:50:26.784Z] "LockAcquisitionPollingInterval": "00:00:05",
[2020-11-19T21:50:26.786Z] "ListenerLockRecoveryPollingInterval": "00:01:00"
[2020-11-19T21:50:26.793Z] }
[2020-11-19T21:50:26.797Z] HttpOptions
[2020-11-19T21:50:26.804Z] {
[2020-11-19T21:50:26.812Z] "DynamicThrottlesEnabled": false,
[2020-11-19T21:50:26.815Z] "MaxConcurrentRequests": -1,
[2020-11-19T21:50:26.816Z] "MaxOutstandingRequests": -1,
[2020-11-19T21:50:26.823Z] "RoutePrefix": "api"
[2020-11-19T21:50:26.825Z] }
[2020-11-19T21:50:26.828Z] Starting JobHost
[2020-11-19T21:50:26.833Z] Starting Host (HostId=valenciaf2l-1803538091, InstanceId=d3ef885e-b69a-4e3c-9b9a-6049a9d34328, Version=3.0.14916.0, ProcessId=21368, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[2020-11-19T21:50:26.869Z] Loading functions metadata
[2020-11-19T21:50:26.887Z] 5 functions loaded
[2020-11-19T21:50:27.031Z] Generating 0 job function(s)
[2020-11-19T21:50:27.066Z] A host error has occurred during startup operation 'f0e7565a-5f40-4e51-a172-b1f53f9e7ece'.
[2020-11-19T21:50:27.068Z] System.Private.CoreLib: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
[2020-11-19T21:50:27.075Z] Stopping JobHost
Value cannot be null. (Parameter 'provider')
[2020-11-19T21:50:27.180Z] Initialization cancellation requested by runtime.
[2020-11-19T21:50:27.185Z] Stopping host...
[2020-11-19T21:50:27.186Z] Host shutdown completed.

@ghost ghost added the Needs: Triage 🔍 label Nov 19, 2020
@omarko
Copy link

omarko commented Nov 20, 2020

I'm in the same boat!

@Structed
Copy link

This might help, @omarko and @fvalencia12: Azure/Azure-Functions#1525

@fvalencia12
Copy link
Author

Well, I don't know what exactly broke my function, it might have been a Visual Studio upgrade which installed .net core 5 or company patching, don't really know.

What I do know is that I downgraded all the 5.0.0 libraries such as Microsoft.EntityFrameworkCore.SqlServer from 5.0 to 3.1 and Microsoft.Extensions.Configuration.UserSecrets from 5.0 to 3.1. That Fixed the problem for me.

The 5.0 libraries are probably .net core 5.0 ready and are having a conflict with Azure Functions or Entity Framework. I have seen this happen when a new version of the .net framework comes out and it takes a few weeks for EF, Azure Functions and other components that sit on top of the framework to iron out their issues.

Oh well, I'll keep out of the 5.0 libraries for a while. This really wasted countless hours this week for me.

@Structed
Copy link

Yes, it cost me and my colleague many hours as well...

Problem is, that there might be transient dependencies on 5.x libs, which does not necessarily mean they won't work - but they might get stripped by the functions core tools.

@mutiadavid
Copy link

Getting same error after updating packages:
A host error has occurred during startup operation '08e2f72c-200d-4b6f-bcc4-4904be42bab7'.
[2020-11-22T22:30:36.800Z] ******.Functions: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

@anthonychu anthonychu added this to the Triaged milestone Nov 24, 2020
@anthonychu
Copy link
Member

Looks like the issue is that Microsoft.EntityFrameworkCore.SqlServer has a transitive dependency on newer versions of some packages such as Microsoft.Extensions.Logging.Abstractions that conflict with the ones running in the functions host. We'll take a look to see how we can address this. @fabiocav

@anthonychu anthonychu added the P1 label Nov 24, 2020
@sebader
Copy link
Member

sebader commented Nov 29, 2020

I'm also affected by this. Also needed to upgrade to Microsoft.EntityFrameworkCore.SqlServer 5.0.0 which probably broke it.

@AartBluestoke
Copy link

AartBluestoke commented Nov 29, 2020

as i commented in Azure/azure-functions-host#6893 (comment)

  • when you run azure functions, it starts before it loads your code.
  • only 1 version of a dll can be loaded at once.

Consequence: if you need a library that is a direct or indirect dependency of webjobs version loaded by azure functions you can only use a version binary compatible with what 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.

image

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.

@TissonMathew
Copy link

Any resolution on this? We are getting the same error System.Private.CoreLib: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

"Function host is not running." when the function app URL is clicked.

@anthonychu
Copy link
Member

The only solution is to avoid using v5 packages. We'll have a .NET 5 worker available in preview soon that should unblock this.

@TissonMathew
Copy link

Resolved by downgrading to 3.1 packages.

@fabiocav
Copy link
Member

@AartBluestoke just want to comment to add some clarity.

The following statement is inaccurate:

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.

The only dependencies that are currently restricted are .NET and WebJobs. In those cases, we perform automatic unification within safe ranges. Any other dependency brought by your application is loaded in isolation, and if also used by the host, it is loaded side-by-side with the version the host uses.

Hope this helps.

@ddobric
Copy link

ddobric commented Jan 14, 2021

Is there any update on this?
As long Functions do not support net5, we cannot reference any other project that is built for net5. It would be great to align Azure Functions in the future to a new version of .net.
In real life, a typical project that implements intellectual property is not implemented in the function project. If it would be, we would simply now downgrade the function project to 3.1

But a function project is usually just a wrapper around the real implementation. It is just a single project in the solution of many projects (i.e. 100 projects). Downgrading the function project to 3.1 would mean downgrading all dependencies to 3.1. This is mostly impossible from the organization point of view.

@sebader
Copy link
Member

sebader commented Jan 14, 2021

@ddobric .NET 5 support for Functions is in preview now https://techcommunity.microsoft.com/t5/apps-on-azure/net-5-support-on-azure-functions/ba-p/1973055

@ddobric
Copy link

ddobric commented Jan 14, 2021

Thanks, @ashaherb. Any approx. release date?

@fvalencia12
Copy link
Author

fvalencia12 commented Jan 14, 2021 via email

@luismanez
Copy link

Just to confirm about the .NET 5 worker. Here (https://github.com/Azure/azure-functions-dotnet-worker-preview) I can read:
"One important difference with .NET 5 functions is that "rich bindings", such as Durable Functions or binding to SDK types like Cosmos DB client, are not supported. Use strings and C# objects (POCOs). For HTTP, use HttpRequestData and HttpResponseData objects."

@anthonychu Does it mean we cannot use Durable Functions with that worker, right?

Thanks.

@sebader
Copy link
Member

sebader commented Jan 21, 2021

from this thread

We currently don’t have plans to bring Durable Functions to this worker for the .NET 5 timeframe. We plan to have the host updated to .NET 6 LTS, and Durable Functions should run fine on that. We will evaluate whether we will bring Durable Functions to this worker long term.

@luismanez
Copy link

Thanks for the info @sebader ... sad to see that, as then .net 5 is not an option for me, and .NET 6 is still far. It also makes not possible to use the great new EF Core 5 in Functions v3 (that requires Durable functions)... shame.
Thanks again.

@SRIVASTAVAABHISHEKGAURAV
Copy link

SRIVASTAVAABHISHEKGAURAV commented Jan 22, 2021

Hi @sebader, Hi All Is there any update on below issue Functions runtime error:
: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

Azure Functions v3 (.Net Core)
Target Framework: .Net Core 3.1
Microsoft.EntityFrameorkCore.SqlServer::3.1.4

Note : This same function is running fine from my local but once deployed to portal then getting the Functione runtime error :-(

AZ Func RunTime Error

@SRIVASTAVAABHISHEKGAURAV
Copy link

SRIVASTAVAABHISHEKGAURAV commented Jan 22, 2021

Resolved by downgrading to 3.1 packages.
Hi @TissonMathew
Could you please elaborate/ give more details about the resolution. Because in my case Microsoft.EntityFrameorkCore.SqlServer: is 3.1.4 ..
Thanks in advance

EFCORE SQLSERVER 3 x

@marcelopastorino
Copy link

@anthonychu Thanks for providing this workaround. As I am sure you understand the shortcomings discussed in this thread make .NET 5 somewhat unusable for a lot people, companies and projects. Azure Functions is such a key service for many.
When this workaround will be fully integrated into .NET 5? We need an approximate date to plan which way we go.
Can you please provide that?
Thanks!

@luismanez
Copy link

@evangeloper also note that even with the worker for .NET 5, it won´t support Durable functions until .NET 6 (scheduled for November 2021), so double check you´re not using Durable functions. For me is not an option, so have to go with .net 3.1 :(

@marcelopastorino
Copy link

@luismanez for this particular project I won't be using durable functions. I want to take advantage of the new EF Core 5 features, but this is not an option as of now without the workaround.
I just wish to have a GA date, so I know whether to go with .NET Core 3.1 or .NET 5.

@SRIVASTAVAABHISHEKGAURAV

downgraded all the 5.0.0 libraries such as Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore and Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuitefrom 5.0 to 3.1.x. This resolved the issue for now .

@tanorion
Copy link

Any update on this?

@fvalencia12
Copy link
Author

Just tried upgrading and got that same error I got back in November. Dotnet 6.0 preview is out and we cannot even upgrade to 5. I hope there is a re-architecture of the system at some point to prevent this from happening again. It sure feels like Azure Functions are treated as third class citizens in the Azure ecosystem.

Regards

@IanKemp
Copy link

IanKemp commented Mar 16, 2021

This is not going to get fixed. The only solution is to either keep all your dependencies on version 3.x, or move to .NET 5 and use the .NET 5 out-of-process worker at https://github.com/Azure/azure-functions-dotnet-worker which is effectively still beta, currently has no Visual Studio integration, and will change again when .NET 6 is released.

As I noted to a colleague today, it rather feels like Azure Functions is held together by string and duct tape.

@fvalencia12
Copy link
Author

fvalencia12 commented Mar 16, 2021 via email

@MuhammadBehzad
Copy link

downgrade to v3.1

@fvalencia12
Copy link
Author

That is what I did when I found the issue back in November. But think how fast the world moves now a days and we are stuck on that for 4 months and no end in sight on this. Just not good for such a critical technology.

@fabiocav
Copy link
Member

@fvalencia12, on this comment:

But think how fast the world moves now a days and we are stuck on that for 4 months and no end in sight on this.

With the .NET 5/.NET Worker announcement, we shared detailed roadmap plans for .NET on Functions here, this is consistent with the guidance we've been sharing in issues, particularly about the fact that non-LTS releases would not be supported in the in-proc model. The posts detail the reasons and plans for the future, including how this approach puts us in a position to match the .NET release schedule and support .NET releases (including non-LTS) releases on day one.

The guidance for .NET 5 on functions today is to use the .NET Worker and OOP model, which I believe addresses the initial issue here, so I'll close the issue as there is no further action here, but if there are any questions I can help answer, please let me know.

Thank you for the patience.

@fabiocav
Copy link
Member

One thing I would like to clarify, @IanKemp ; The statement about the worker model changing again when .NET 6 arrives is not accurate. One of the key benefits of the OOP model is the ability eliminate the impact of host version changes on user's workloads. There are no plans to break or deprecate that model and the packages once .NET 6 lands in Functions.

@IanKemp
Copy link

IanKemp commented Mar 18, 2021

@fabiocav Was this required change to a new Functions worker announced ANYWHERE before .NET 5 was released? No, all of a sudden things started breaking when people did ordinary things like upgrading packages, and then all of a sudden there was a new GitHub repo for a new Functions worker, with the Functions team telling people "use this one instead, and by the way integration with VS is missing and existing features like Durable Functions aren't supported".

There is NO WORLD in which that is an acceptable customer experience, and as a result customers are having a lot of difficulty trusting your team - especially since this comes after the Newtonsoft.Json and SqlClient debacles. So when you say "there won't be any further changes required after you update to this beta version", I'm sorry but I just don't believe you, because pretty much all my experiences so far with Azure Functions have been incredibly, unnecessarily painful.

Do you know what would help this lack of trust? Humility and honesty. A simple blog post apologizing for the fact that the OOP runtime wasn't implemented for .NET forever ago (which would have prevented all these issues), apologizing for the fact it wasn't ready for .NET 5's launch, and apologizing for the fact this runtime is still effectively beta (if it's not fully integrated with your flagship IDE, and it lacks features, it's not a finished product). Plus a recommendation that unless customers absolutely require .NET 5 features, they should remain on v3 of the runtime until the v5 OOP runtime is fully complete.

I appreciate that the Microsoft of 2021 is against admitting fault for anything, but that's a very dangerous place to play in, because it makes it difficult for customers to empathize and cut some slack when problems do inevitably occur. We're all devs, we all screw up, and there's nothing wrong with being honest about that.

@fabiocav
Copy link
Member

@IanKemp I completely appreciate and empathize with where you're coming from here. We understand (although it's clear communication was not sufficient), the impact this has had on many customers, particularly when the message from different teams were conflicting (i.e. use the latest and greatest vs this is not yet supported).

We're absolutely not against or above admitting fault in situations like this, I know I have personally apologized for the impact some of the issues had in threads you were involved in the past, and this here applies. We had a few other issues/threads on this topic, and myself and the team were striving to be as open and engaged as we could be while continuing to work on the problem. And I'm truly sorry if that missed the mark.

On the topic of trust, that's a particularly hard hitting one as I know I can speak for the entire team when I say we've been trying to be as transparent as we can and share as much as possible. This has been a continuous process, and we learn from every single one of this issues, and I truly hope the information shared in the announcement I've linked to is evidence of that (we're sharing the roadmap all the way to .NET 8 and the path for future versions after that). We've shared a lot of information on this thread, but a better communication mechanism would have helped. I can assure you (and completely understand if this doesn't mean much, as we are on the topic of trust here), that there has been no malicious intent from the team to withhold information or mislead users. With that, I would restate that no changes are currently planned that would impact your investment in the OOP worker model today. I hope you understand that, if a statement about changes happening to that model when .NET 6 is made here, the team has an obligation to clarify that as it could lead others to believe this is a planned activity.

About the release status, we have to be accurate, as preview, alpha, beta, GA designations have a very concrete and well-defined meaning, which has an impact on SLA and other commitments many customers depend on. The .NET 5 Worker support is GA. Yes, I agree with you that without strong tooling support, it remains incomplete, but the GA designation is a statement that all of our GA commitments and obligations are in place. You can bring production workloads to Functions using that model and if you have issues, the standard SLA and support procedures apply.

We're truly focused on the path forward here, and I hope we can regain your trust as we continue execution on the plan we've shared. I also want to thank you for the ongoing feedback; we relay what we hear on GitHub and other channels internally to our leadership team, and we are taking action to ensure this improves.

I'm also open if you'd like to reach out to me directly. Email is on my profile, so please feel free to use that.

@Varada
Copy link

Varada commented Mar 21, 2021

image
With Functions 3.0.11 -> WebJobs 3.0.23 - it looks like the transitive dependency is to Logging.Abstractions 5.0. I have this referenced.

Core Tools Version: 3.0.3388 Commit hash: fb42a4e
Function Runtime Version: 3.0.15371.0

My app is a .net coreapp 3.1

Even in this combination, func fails

A host error has occurred during startup operation '466fe26f-2328-4d9a-9fe3-072639dcd615'.
[2021-03-21T22:25:52.905Z] System.Private.CoreLib: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

What options do I have to unblock myself?

@fvalencia12
Copy link
Author

fvalencia12 commented Mar 22, 2021 via email

@gh0st1596
Copy link

Varada, I had the very same issue. After updating Visual Studio recently, I couldn't run my project locally because of the
System.Private.CoreLib: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0 error that you mentioned and I couldn't change its version because it depends on the WebJobs package.

The way I fixed this was by adding the Microsoft.Extensions.Logging.Abstractions package directly to my project and it automatically overrode the one with the version that I just added (2.1.0 in my case). I got some errors in other projects which I fixed by downgrading all the other Microsoft.Extensions.Logging.Abstractions dependencies to the same version in my other related projects and everything was back to normal.

Hope this helps

@drfbwilliams
Copy link

@gh0st1596

The way I fixed this was by adding the Microsoft.Extensions.Logging.Abstractions package directly to my project and it automatically overrode the one with the version that I just added (2.1.0 in my case).

Hi there - how exactly did you do this and get it to work? I have tried manually adding and referencing the earlier version and I am still smashed by this disgraceful bug when attempting to implement SignalR

Many thanks for any help

@mithom
Copy link

mithom commented May 3, 2021

@fabiocav the issue here is not that .NET 5 is not supported but that all packages that also support fully backward compatibility with .netcore3.1 also do not work. Entityframework core 5 works perfectly fine with .netcore3.1 just like the logging.Abstractions 5 works fine with it. The issue is not that you are changing the model for .NET 5 (it is, but it's a different problem, no large file support due to no rich binding is a breaking issue for almost any project), but that even in the current production environment we are locked to old tools because upgrading something that is fully backward compatible like the logging.abstractions is not updated. this one simple change would already unlock so many blocking issues without having an impact on your codebase at all. Don't tell me that upgrading that package would be difficult for you guys as lead cloud platform, it's freaking your own technology...microsoft

@trailmax
Copy link

trailmax commented May 5, 2021

Why is this closed? Just hit this issue and none of the workarounds provided are working. Can't upgrade to Functions 5 because durable functions is not available in v5.

@IanKemp
Copy link

IanKemp commented May 5, 2021

Why is this closed? Just hit this issue and none of the workarounds provided are working. Can't upgrade to Functions 5 because durable functions is not available in v5.

It's closed because it's WONTFIX. If you need durable functions, you're sadly stuck on .NET Core 3.1 until at least .NET 6.

@trailmax
Copy link

trailmax commented May 5, 2021

@IanKemp Ok, thanks for the clarification.

Seems like I'm stuck between a rock and a solid place. Core 3.1 does not work with logging, v5 is not an option because durable is not available, .Net 6 is in early preview and I need it running in production yesterday (it was running in production yesterday).
This sucks big time.

@luismanez
Copy link

@trailmax although I feel your pain, and totally agreed about Durable functions not available for .net 5... what´s the problem with logging? I have a solution in .Net 3.1 (Durable functions), and logging is working fine using 3.1 version package. I´m using 3.1.10 version for most of the Microsoft.Extensions.*

@trailmax
Copy link

trailmax commented May 7, 2021

@luismanez The said nuget is depdendency of a depdency and I can't downgrade it. Installing that package of the 3.x version directly in my projects only results with antoher build error of "unable to downgrade dependency, version conflict" (or whatever the correct error is - don't have it in front of me now).

@luismanez
Copy link

oh, I see, yeah, it´s a mess then. All my dependencies are in a version that don´t require MS.Extensions version greater than 3.x.
It´s frustrating. Sorry.

@adamfoneil
Copy link

adamfoneil commented May 14, 2021

Resolved by downgrading to 3.1 packages.

how exactly do you downgrade to 3.1? When I try to do this, I get that infuriating "downgrade detected" error.

image

Just a follow up to answer my own question -- I figured this out by looking at dependencies of referenced projects. I had some 5.0 packages in referenced projects, which was bumping up the dependent version in the Function project.

@fvalencia12
Copy link
Author

fvalencia12 commented May 14, 2021 via email

@trailmax
Copy link

@adamfoneil I was in the same boat - I had to bite the bullet and upgrade to .Net 5. No known workaround for this scenario :-(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests