V1 to V4 .net function app conversion issue

Manish Keshvala 0 Reputation points
2023-11-20T17:41:56.35+00:00

Hi,

I converted a V1 function app to a V4 .net framework 4.8 isolated function app. (contains HTTP trigger functions)

Updated the project as per Microsoft doc, however when i run it locally or publish it to Azure and invoke the HTTP endpoint through postman I get below error:

Could not load file or assembly 'file:///C:\Test\ConversionProject.dll or one of its dependencies. The system cannot find the file specified.

My .net project is called ConversionProject and i've set it to a console ap as per documentation and added the program.cs file.

Any help or pointers on what could cause the above error would be greatly appreciated.

Thanks in advance

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

2 answers

Sort by: Most helpful
  1. Manish Keshvala 0 Reputation points
    2023-11-21T11:59:53.9566667+00:00

    I had the latest nuget packages in my project, however after i rolled back the version of Microsoft.Azure.Functions.Worker.Sdk to 1.15.1 from 1.16.2, i can now get the function app to run locally and after publishing it to Azure resources.

    When a colleague of mine created a new project on his machine it added the 1.15.1 nuget package and ran successfully, then found below solution to use latest package but with a FunctionsEnableWorkerIndexing attribute in the project file.

    https://github.com/Azure/azure-functions-dotnet-worker/issues/2072

    0 comments No comments

  2. MayankBargali-MSFT 70,126 Reputation points
    2023-11-22T14:46:24.3166667+00:00

    @Manish Keshvala

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that The question author cannot accept their own answer. They can only accept answers by others, I'll repost your solution in case you'd like to "Accept" the answer.

    Issue:

    You try to convert your V1 function app to a V4 .net framework 4.8 isolated function app. (contains HTTP trigger functions) and observed that when you run it locally or publish it to Azure and invoke the HTTP endpoint through postman you get below error: Could not load file or assembly 'file:///C:\Test\ConversionProject.dll or one of its dependencies. The system cannot find the file specified.

    Solution:

    You found the github issue : https://github.com/Azure/azure-functions-dotnet-worker/issues/2072 and you rolled back Microsoft.Azure.Functions.Worker.Sdk to 1.15.1 from 1.16.2 and confirmed that the issue is resolve. When using latest package when you set FunctionsEnableWorkerIndexing attribute in the project file as below which resolves the issue with latest package. <FunctionsEnableWorkerIndexing>False</FunctionsEnableWorkerIndexing>

    Thank you again for your time and patience throughout this issue.

    0 comments No comments

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.