-
Notifications
You must be signed in to change notification settings - Fork 38
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
Method not foundMicrosoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services() since .Net Core 3.1 release #32
Comments
I also have this issue with .NET Core 3.1 and Microsoft.Extensions.* 3.1.0 packages. I think it's a similar issue as #29 back with .NET Core 3.0. My current workaround is using Microsoft.Extensions.* packages in version 3.0.0. |
I'm getting a similar error while trying to do a
This is my current setup:
And this is my <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.1" />
<PackageReference Include="Utf8Json" Version="1.3.7" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Demo.Domain.Interfaces.Repository;
namespace Demo.Functions
{
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
builder.Services.AddSingleton<IDemoRepo, DemoRepo>();
}
}
}
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"FUNCTIONS_EXTENSION_VERSION": "~3"
}
}
{
"version": "2.0",
"healthMonitor": {
"enabled": true,
"healthCheckInterval": "00:00:10",
"healthCheckWindow": "00:02:00",
"healthCheckThreshold": 6,
"counterThreshold": 0.80
},
"functionTimeout": "00:10:00"
} This might be related #5 |
Also just ran into this issue upgrading a working function app from v3-preview/ASP.NET Core 3.0 to v3/ASP.NET Core 3.1. Guess we're not upgrading to 3.1 yet! |
FYI I fixed my issue updating azure-functions-core-tools from 3.0.1740 to 3.0.1975. It just came out two days ago, so none of you above would have had it yet. |
Same error, with |
Updating to 3.0.1975 solved this for me also. But only if I start the function from command line. Starting in Visual Studio the error still occurs. I think VS has an older version of the runtime , which still is on dotnet core 3.0, bundled. |
That resolved my issue too. |
@FrankGagnon can you validate with the latest version and let us know if this is still an issue? |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
I am not getting this error when developing, but I am when the function is published to Azure:
Here is my .csproj: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.2" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project> |
@laurentlbm-rc is your Function App version on Azure set to 3.0? (~3)? Can you please share an invocation ID, region and timeframe so we can look at some details? |
@fabiocav Ah, I feel stupid, that was the issue, it's working fine now. I'm not the one who created the function app and I didn't think to look at that. |
I am having the same issue in production:
Everything is fine locally, however in the function app i am getting the same exception on startup. My Function App is referencing two Function app:
class libraries:
Wondering if EF Core reference is the issue although it should not be? I had issues before locally but not since upgrading to dotnet core 3.1. Regards, Robert |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
For anyone still having issues. What worked for me was changing the AzureFunctions entry in my projct file from My project file now looks like this
All my referenced projects are Hope that helps |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
@kevinbrydon thanks for the tip regarding AzureFunctionsVersion in the project file. |
I'm still having my issue described above: Only when I run the function with the cli @fabiocav Is there some action already to make it work with Visual Studio again? I'm using the latest VS preview version. |
@plazav Can you ensure the following things Your
Your host.json should be
In Azure Portal, your functions If the above is all correct, it might be worth deleting and recreating your function in azure. Upgrade it to |
Hi @kevinbrydon, The settings that you have provided are correct. |
@plazav Just to be clear. You're having the Currently the only difference between me and you is that I am using the consumption plan. If you are able to share your source code, pipeline script and function template then that might help. |
@kevinbrydon Yes, I am having the issue And yes, I am developing on Windows 10. Could it be that this issue happens because I have reference to |
@plazav That error you are getting is different to the one being discussed in this thread. I don't think any of the solutions posted will help you. If it was me, I'd start from scratch. Simple function, no constructor, empty Startup (or a Startup.cs
|
@kevinbrydon @plazav The bug you're getting is documented elsewhere and prevents overwritting IConfiguration within DI for things like loading Azure Keyvault. Do a search and you'll find the topic. Worked in 2.1, doesn't work in 3.1. There's a VERY ugly work around. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
Do you mind share What is work around? Thanks! @plazav i am getting exactly the same issue you are getting during publish, nerver found it to be an issue running at my local environment. |
Hi @JohnGalt1717, I managed to get v3 of I've tested this in a vanilla docker container (bionic image, so it's 18.04), so this should cover everything needed, and many steps probably not needed for you - just the last few. I fire up the container like so:
Then, in that session, I run the following:
More info:
I end up with:
|
@leighghunt Thanks. That's ultimately what I ended up doing too. It's really ugly and the only platform that makes you go through such hoops. And if you look at the official approach, it's also at least 1 version of V2 behind for over a week as well. This needs to be addressed so that packages are both released at the same time as everyone else gets them, and there's an easy and managed way to get beta channel releases. (especially when Azure Functions is so far behind in releasing current versions for .NET Core and the last version supported (.net 2.2) is no longer supported by MS forcing us all to use beta versions of Azure Functions or have major issues. I'd suggest moving to npm like on Windows. Or Snaps with channels. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
This should not be closed... |
Ya, this should be reopened because the issue is still there: This needs to be addressed by the team so that it's possible to actually get these on linux etc. |
Issue still exists in latest version. |
Reading through this issue, I think one of the problems is there seems to be a lot going on here. Everything from needing to make sure you are setting to ~3 in the cloud, using the v3 version of the core tools, and an updated version of the host that went out a few weeks back. I’m not saying there aren’t valid issues occurring, the the original post very likely could be resolved by one of those fixes (and a few others in the thread). For folks who are still hitting other issues, please feel free to open or flag a different issue. Please be sure to include as much detail as possible into what errors or issues you are hitting so we can track correctly. Want to make sure we resolve any issues that are occurring without also accidentally tracking 4 very different issues all under the same one. |
Hi, How about running That fixed the problem for me for Ubuntu on WSL (found this here: https://github.com/Azure/azure-functions-core-tools) |
Sweet - this now appears to be running, follwing Azure/azure-functions-core-tools@3f27711 My earlier test in docker container is now much shorter:
In that session:
The running
|
I posted a sample to reproduce the DependencyInjection error with the minimum stuff here: https://github.com/Azure/azure-functions-dotnet-extensions/issues/36#issuecomment-594979004 |
@leighghunt As previously stated, that works NOW because the final version has been released. The issue is that pre-releases cannot be pulled any other way but manually right now and it needs to be corrected so that Linux has parity with Windows and Mac. |
Hi,
When updating our nuget packages like
Microsoft.Extensions.DependencyInjection.Abstractions
and
Microsoft.Extensions.Configuration
to version 3.1.0 released with .Net Core 3.1 yesterday, the Function host fails to start with the following error : Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services()'
I'm using the latest VS version, 16.4.0 and the v3 preview function runtime.
Thanks,
Frank
The text was updated successfully, but these errors were encountered: