0

I have created a C# V2 Azure durable function which runs ok when I run in Visual Studio 2019. However, once deployed to Azure, I'm presented with the following:

The function runtime is unable to start. Interfaces.Avaloq.Presentation.AzureFunctions: Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.WebJobs.IWebJobsBuilder.get_Services()'.

In Azure, I see the following: Runtime version: 2.0.12775.0 (~2)

The package references from the cs proj are as follows:

<PackageReference Include="FluentValidation.AspNetCore" Version="8.5.0" />
    <PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="7.0.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="3.0.2" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="1.8.2" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="3.0.5" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.10" />
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
    <PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.2.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.27" />
    <PackageReference Include="Base.Core.SharedKernel" Version="1.0.0.26447" />
    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />

I am building for .Net Core v2.2:

<TargetFramework>netcoreapp2.2</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>

I have set a breakpoint in the "Configure" method of the "Startup" class, then attached the VS2019 debugger to the deployed Azure function. Although the breakpoint seems to be set ok (solid red circle), it is never hit.

Using the Kudu tool, I downloaded a copy of the Azure Function's eventlog.xml. Even after redeploying the Function App (using DevOps release pipeline), I continue to see the following in here:

Msvsmon was unable to start a server named '127.0.0.1:50006'. The following error occurred: An instance of the remote debugger is already running on this computer, or another process is already bound to the specified TCP/IP port

What's the best way to troubleshoot?

p.s. it seems lots of people have the same problem: https://github.com/Azure/azure-functions-dotnet-extensions/issues/29

Rob Bowman
  • 7,632
  • 22
  • 93
  • 200
  • Which language and which version of its framework are you using? Did you try remote debugging? Is the Functions App configured to run on the same version that you defined in the application? In short: could you give us some more info? – rickvdbosch Oct 21 '19 at 09:09
  • @rickvdbosch I have added more detail to the question – Rob Bowman Oct 21 '19 at 09:41
  • You say you can run successfully on local, but when upload to Azure it failed. From the error it seems comes from the version of the sdk. – Cindy Pau Oct 21 '19 at 09:45
  • Which .NET Core runtime are you targeting? If you use .NET Core 3 you'll have to target [Azure Functions 3](https://dev.to/azure/develop-azure-functions-using-net-core-3-0-gcm) or go back to .NET Core 2.2 – Panagiotis Kanavos Oct 21 '19 at 09:45
  • Yes, the .net core version you use is the key – Cindy Pau Oct 21 '19 at 09:47
  • Ho @PanagiotisKanavos I'm using .Net Core v2.2 – Rob Bowman Oct 21 '19 at 09:48
  • @RobBowman Can you try updating the `Microsoft.Extensions.DependencyInjection` package to the latest stable one `3.0.0` Also update the `Microsoft.NET.Sdk.Functions` to `1.0.29` – HariHaran Oct 22 '19 at 04:13
  • @HariHaran, I'm afraid that made no difference - I still get the same error – Rob Bowman Oct 22 '19 at 05:55

1 Answers1

0

Problem solved by updating to .Net Core 3.0. For instructions see: https://dev.to/azure/develop-azure-functions-using-net-core-3-0-gcm

Rob Bowman
  • 7,632
  • 22
  • 93
  • 200