我有一个 Azure Function 项目,我想使用 Azure Functions Core Tools v4.x 运行该项目。但 Visual Studio 始终选择 Azure Functions Core Tools 2.6。这样,我收到以下错误:
You are using an outdated version of the Azure Functions Core Tools. For more information, please see: https://aka.ms/func-v2-upgrade
我删除了 %LocalData%/AzureFunctionTools/Releases/
中的所有 Azure Functions Core Tools 运行时。但当我再次运行该项目时,Azure Function Tools 2.6 版本正在安装。
如何更改它以使用 4.x 版本?
我正在使用:
- Visual Studio 2022
- Windows 11
- .NET Core 2.2
更新:
I found this article on the internet 。但仅仅向项目添加新功能对我来说不起作用。但是当我创建新项目时,它选择最新版本的 Azure Function Core Tools 4.x 。我仍然不知道如何对现有项目执行此操作。
最佳答案
就我而言,尽管安装了较新的版本,但 Visual Studio 2022 仍在使用旧版本的函数运行时。
这来自以下文件夹: C:\Users<用户名>\AppData\Local\AzureFunctionsTools
即使删除了文件夹内容,它们每次都会重新生成,但仅限于旧版本。
我必须转到 Visual Studio 设置,在那里我找到了一种更新到最新版本的函数工具的方法。其他地方没有任何通知要求我升级。
关于.net - Visual Studio 检测旧的 Azure Functions 核心工具版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75659559/