During the release process of the Azure Function project, there used to the. net5 stack, but the project uses. net6

txsun 0 Reputation points
2025-01-26T11:19:00.73+00:00

We tried to release a container for the function app project in VS and found that some projects had no problems after compilation and packaging, but some projects would encounter errors when running after compilation and packaging.

“Method not found Void Azure Core TokenRequestContext”

The project with errors includes a main project and two test projects. After repeated checks, we confirmed that the current project contains multiple versions of the Azure Core dll in the built package, and the error was caused by calling an older version of the Azure Core dll.

Later, we tried again and found that we need to add a line of <ItemGroup> in the csproj of the test project to introduce the csproj of the main project. In the case of introduction, there will be no problem in compiling and publishing!

We confirmed that this issue occurs when using the sln project file to build a function app with multiple projects during publishing. We need to know if this is a bug? Or what suggestions does the development team have for this situation?

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

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 71,506 Reputation points
    2025-01-26T17:49:08.29+00:00

    See the nuget transitive package dependency rules.

    https://devblogs.microsoft.com/nuget/introducing-transitive-dependencies-in-visual-studio/

    note: you can control versions by explicitly specifying the version in the target project.

    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.