Receiving error while trying to run Azure Functions in VS 2022

Marshall Desouza (US) 20 Reputation points
2023-07-25T20:04:09.3333333+00:00

Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.ReceiveGifMessagesSecondary'. System.Private.CoreLib: Could not load type 'Microsoft.Azure.WebJobs.Host.SupportsRetryAttribute' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.31.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

[2023-07-25T19:01:16.081Z] Function 'Functions.ReceiveGifMessagesSecondary' failed indexing and will be disabled.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,417 questions
{count} votes

Accepted answer
  1. navba-MSFT 27,465 Reputation points Microsoft Employee
    2023-07-26T05:18:29.12+00:00

    @Marshall Desouza (US) Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    I understand that you are encountering the error ystem.Private.CoreLib: Could not load type 'Microsoft.Azure.WebJobs.Host.SupportsRetryAttribute' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.31.0 while running your Azure Function App on VS 2022.

    It seems that the error is related to the Azure Functions runtime and the version of the Microsoft.Azure.WebJobs.Host assembly.

    Please follow the below action plan and check if that helps:

    • To resolve this issue, we recommend checking the version of the Microsoft.Azure.WebJobs.Host assembly that you are using. The error message indicates that the assembly version is '3.0.31.0'. This version may not be compatible with the Azure Functions runtime that you are using.
    • Please run the command func --version and check the Function core runtime version. Ensure that you are using an updated and most recent version (4.0.5198).

    Please uninstall and reinstall the most recent Function core tools https://github.com/Azure/azure-functions-core-tools#installing

    • We suggest updating the Microsoft.Azure.WebJobs assembly to a most recent version that is compatible with your Azure Functions runtime. You can find the latest version of the assembly in the NuGet package manager in Visual Studio. Also the most recent version for this is 3.0.37 (see here)
    • Additionally, you can try cleaning and rebuilding your project to ensure that all dependencies are up to date and correctly referenced.
    • Check if any incorrect versions (or older versions) references are added within your .csproj file.

    If the issue persists, you can try creating a new Azure Functions project and copying your code into the new project. This can help ensure that all dependencies are correctly set up.

    Sharing some articles where similar issue was reported:
    https://stackoverflow.com/questions/70800974/could-not-load-type-microsoft-azure-webjobs-host-scale-concurrencymanager-from
    https://github.com/Azure/azure-functions-dotnet-extensions/issues/54

    Hope this helps.

    **
    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.