0

I working on migrating Azure function app (servicebus trigger) from .NET 4.8 to .NET 8 which is working in my local as expected without any errors. When I deploy the function app to Azure Portal I am facing the below error.

"Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. Grpc.AspNetCore.Server: Could not load file or assembly 'Microsoft.AspNetCore.Routing, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified."

Here is my .Cs proj file code :

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Azure.Storage.Blobs" Version="12.22.2" />
    <PackageReference Include="Azure.Storage.Common" Version="12.21.1" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.13.0" />
    <PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.5.0" />
    <PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
    <PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
    <PackageReference Include="System.Net.Http" Version="4.3.4" />
    <PackageReference Include="System.ServiceModel.Duplex" Version="6.0.0" />
    <PackageReference Include="System.ServiceModel.Http" Version="8.0.0" />
    <PackageReference Include="System.ServiceModel.NetTcp" Version="8.0.0" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Instances\" />
  </ItemGroup>
</Project>

I am facing this error only in AzurePortal, it's working in my local Environment as expected.

Would like to understand the issue

1
  • Are you deploying the app to the existing function app? Commented Nov 24, 2024 at 4:41

1 Answer 1

1

The issue is fixed now after updating all the nuget packages to the latest version and downgrading the Microsoft.Azure.WebJobs.Extensions.ServiceBus to 5.120. 0.

Added the below value in Azure portal in the Configuration enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.