azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

Value cannot be null. (Parameter 'provider')

Open cosswift opened this issue 4 years ago • 17 comments

Seeing that the other issues that had this error did not quite fill the bill, I wanted to add my two cents. I built a project that was similar to the example provided and all was well, but when I added a project that contained a reference to Microsoft.EntityFrameworkCore version 5.0.0, also tried 5.0.1, I received the error message below. What is in the EF Core 5 that is causing this problem?

[2020-12-15T03:56:19.269Z] Reading host configuration file 'C:\working\Repos\ProDriver.Api\Functions\bin\output\host.json' [2020-12-15T03:56:19.273Z] Host configuration file read: [2020-12-15T03:56:19.274Z] { [2020-12-15T03:56:19.274Z] "version": "2.0", [2020-12-15T03:56:19.275Z] "functionTimeout": "00:35:00" [2020-12-15T03:56:19.276Z] } [2020-12-15T03:56:19.285Z] A host error has occurred during startup operation '6c8e42bb-381c-4450-a7c2-976fe155a261'. [2020-12-15T03:56:19.287Z] Functions: Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.WebJobs.IWebJobsBuilder.get_Services()'. Value cannot be null. (Parameter 'provider') [2020-12-15T03:56:19.344Z] Initialization cancellation requested by runtime. [2020-12-15T03:56:19.347Z] Stopping host... [2020-12-15T03:56:19.348Z] Host shutdown completed.

cosswift avatar Dec 15 '20 04:12 cosswift

We're evaluating some options for addressing this in a .NET Core 3.1 Azure Functions app. For now, our recommendation is to use our recently announced .NET 5 worker.

anthonychu avatar Dec 15 '20 19:12 anthonychu

@anthonychu I was using the .NET 5 worker that you suggested.

cosswift avatar Dec 15 '20 20:12 cosswift

Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services()'. Value cannot be null. (Parameter 'provider')

We just started getting the message above, what would be causing this?

jwisener avatar Dec 15 '20 22:12 jwisener

We are experiencing the same problem.

V3 Azure Function using .NetCore 3.1 and EFCore 3.1.8. -> works nice and smooth. update EFCore to 5.0.0. - 5.0.2. ->

Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services()'. Value cannot be null. (Parameter 'provider')

when executed locally. CLI is uptodate.

SkyFlyHH avatar Jan 17 '21 09:01 SkyFlyHH

I've got the same issue. EFCORE 3.x works upgrade to 5.x and I get:

Method not found: 'Microsoft.Extensions.Configuration.IConfigurationBuilder Microsoft.Extensions.Configuration.EnvironmentVariablesExtensions.AddEnvironmentVariables(Microsoft.Extensions.Configuration.IConfigurationBuilder)'. Value cannot be null. (Parameter 'provider')

josiahhooten avatar Jan 26 '21 21:01 josiahhooten

Any news on this? Trying to fix one bug related to EF by bumping to new version another pops out right from behind. Really frustrating :)

zukauskasp avatar Mar 03 '21 14:03 zukauskasp

@anthonychu You said you were evaluating options for NETCore3.1 other than the new Net5Worker... What are those options? Most of my functions apps are currently broken while trying to update package that show as compatible with NETStandard 2.1. They show similar errors to the OP. I know functions are a complete mess with the Host runtime right now, but a workable solution for deploying Core 3.1 would be great.

pseabury avatar Mar 19 '21 18:03 pseabury

We were looking into whether we can safely update the host dependencies to be compatible with the 5.x packages, but I don’t think we’ve found a way to do this without breaking existing apps. The recommendation is to use the .NET isolated worker or stay on 3.x dependencies until we have an updated version of that host that supports .NET 6 (preview ETA this summer). /cc @fabiocav

anthonychu avatar Mar 22 '21 02:03 anthonychu

this dependency system is just pathetic. efcore 5.0 supports .netcore 3.1, azure functions v3 supports .netcore3.1 but since they usehow somewhere use a different version of the logging system that is supported in .netcore 3.1, thye just don't work together..... how even. Don't get me started on explaining how dll loading work pls, i know how it works, and yet no other programming language has this issue.

you suggest using the .NET 5.0 preview, but this one only supports using string or byte[] for the initial trigger. where the documentation from in-process functions explicitly says not to use them for larger blobs. Guess what? i need to use larger blobs. for files of size 70Mb this already isn't working anymore while it works within ms on the old system.

Due to compatibility reasons with another project we cannot use ef core 3.1 since that one uses ef core 5 already and due to the same stupid nuget system, you can't use both in the same project...

so 2 projects that for no sensible reason whatseover shouldn't work together, don't because of a LOGGER!!!!!!! any workarounds? that don't need to wait untill summer, because my company does not accept waiting untill summer for this LOL

mithom avatar Apr 29 '21 15:04 mithom

@cosswift The following worked for me:

  • Activate debug image

This shows that the problem is that when trying to download Microsoft.Azure.Functions.ExtensionBundle the download takes a long time and the process dies.

Solution

Download the version of Microsoft.Azure.Functions.ExtensionBundle that they are using and then manually place it in .azure-functions-core-tools / Functions / ExtensionBundles / Microsoft.Azure.Functions.ExtensionBundle inside a folder with the version as name.

image

Niurmiguel avatar Jun 17 '21 16:06 Niurmiguel

@cosswift The following worked for me:

  • Activate debug image

This shows that the problem is that when trying to download Microsoft.Azure.Functions.ExtensionBundle the download takes a long time and the process dies.

Solution

Download the version of Microsoft.Azure.Functions.ExtensionBundle that they are using and then manually place it in .azure-functions-core-tools / Functions / ExtensionBundles / Microsoft.Azure.Functions.ExtensionBundle inside a folder with the version as name.

image

Hey I think this might just work @Niurmiguel, could you add where you Download the version of Microsoft.Azure.Functions.ExtensionBundle

Bayurzx avatar Jul 09 '21 20:07 Bayurzx

It worked for me. If you run the func start --verbose one can see where bundle file is being downloaded from.

poly-mole avatar Mar 20 '22 15:03 poly-mole

@cosswift The following worked for me:

  • Activate debug image

This shows that the problem is that when trying to download Microsoft.Azure.Functions.ExtensionBundle the download takes a long time and the process dies.

Solution

Download the version of Microsoft.Azure.Functions.ExtensionBundle that they are using and then manually place it in .azure-functions-core-tools / Functions / ExtensionBundles / Microsoft.Azure.Functions.ExtensionBundle inside a folder with the version as name.

image

This worked for me...

In case you might be wondering like @Bayurzx where to download the version, you can find it by using --verbose like @poly-mole said, here is just a screenshot to find it easier image

BUT, to add something extra, when @Niurmiguel said about ".azure-functions-core-tools" and you're using Windows, that directory should be:

C:/Users/{yourUser}/.azure-functions-core-tools

And you can find the version in the screenshot with the ...X.Y.Z_any.zip :) so it's easier.

asfo avatar May 13 '22 16:05 asfo