azure-functions - 无法在 Visual Studio Mac 中更新 Azure Functions 核心工具

标签 azure-functions visual-studio-mac

我正在开发一个 Azure Functions 应用程序,它具有各种不同的触发器(HTTP、QUEUE、TIMER 和 SignalR)。当我在我的工作电脑 (Windows) 上进行开发时,它们运行良好,但当我在家中使用 Mac 进行开发时,它们无法正常工作。

我收到以下错误:

A host error has occurred [28/03/2019 20:37:53] Microsoft.Azure.WebJobs.Extensions.Storage: Could not load type 'Microsoft.Azure.WebJobs.Hosting.IOptionsFormatter' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Value cannot be null. Parameter name: provider



仅当我添加(到干净的项目)Microsoft.Azure.WebJobs.Extensions.Storage nuget 包时,我才会收到此错误。

事实证明,我正在运行与 GiddyUpHorsey 完全相同的 SDK 版本。是,按照 BrettSam 的建议,我尝试按照 the docs 通过 Brew 更新 CLI也可以通过 NPM 按照 this answer

然而,正如你在这里看到的,没有任何作用

in theory updating code

nope doesnt work

有任何想法吗?

最佳答案

Visual Studio for Mac 7 不支持使用 Azure Functions Core Tools 的 Homebrew 安装。 Visual Studio for Mac 7 提供了这些工具的副本,并且只会使用这些工具。

Visual Studio for Mac 8 确实支持这一点。如果发现模板和 Azure Functions 核心工具本身已过期,它还有一个内置功能可以更新本地目录中的模板和 Azure Functions 核心工具本身。 Azure Functions 团队提供 Visual Studio for Mac 将使用的在线源。在新项目中创建新的 Azure Functions 项目时可以使用此更新功能。

如果使用的是 Visual Studio for Mac 7,您可以将更新版本的工具复制到目录中:

/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.AzureFunctions/azure-functions-cli/

但是,我会备份该目录或整个 Visual Studio.app首先,在尝试更新这些文件之前,如果它不起作用,您可以回滚。

关于azure-functions - 无法在 Visual Studio Mac 中更新 Azure Functions 核心工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55406677/

相关文章:

azure-functions - 无法从 Azure Key Vault 读取值

azure - 如何使用用户分配的身份触发 blob 函数

macos - 在 Mac 上安装 Visual Studio Professional,只有社区会为我安装

git - 无法在 Visual Studio Mac 上更改分支

azure - OAUTH/Azure 函数 : Method to auth AAD user for endpoints that don't support service principals

node.js - azure 函数 javascript 锐利模块

ios - Xamarin.iOS 版本不匹配 11.14

c# - Visual Studio 2017 Mac上的SoundPlayer没有声音

azure - 使用服务主体身份验证从 azure 函数读取 AD 组

azure - 您可以从 Visual Studio Mac 创建 Azure Functions 吗?