无法在 Visual Studio Mac 中更新 Azure Functions 核心工具 [英] Unable to update Azure Functions Core Tools in Visual Studio Mac

查看:10
本文介绍了无法在 Visual Studio Mac 中更新 Azure Functions 核心工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 Azure Functions 应用程序,它具有各种不同的触发器(HTTP、QUEUE、TIMER 和 SignalR).当我在我的工作电脑 (Windows) 上开发时,它们可以正常工作,但当我在我的 Mac 上在家开发时,它们就无法正常工作.

我收到以下错误:

<块引用>

发生主机错误[28/03/2019 20:37:53] Microsoft.Azure.WebJobs.Extensions.Storage:无法从程序集Microsoft.Azure.WebJobs.Host,版本="加载类型Microsoft.Azure.WebJobs.Hosting.IOptionsFormatter"3.0.3.0,文化=中性,PublicKeyToken=31bf3856ad364e35'.值不能为空.参数名称:提供者

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

事实证明,我运行的 SDK 版本与

有什么想法吗?

解决方案

Visual Studio for Mac 7 不支持使用 Homebrew 安装 Azure Functions Core Tools.Visual Studio for Mac 7 附带了一份工具副本,并且只会使用这些工具.

Visual Studio for Mac 8 确实支持这一点.它还具有内置功能,可以在本地目录中更新模板和 Azure Functions Core Tools 本身,如果它发现这些已过时.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,以便在它不起作用时回滚.

I'm developing an Azure Functions App which has a variety of different triggers (HTTP, QUEUE, TIMER and SignalR). They work fine when I'm developing on my Work PC (Windows) but they don't work when I'm developing at home on my Mac.

I get the following error:

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

I get this error only when I add in (to a clean project) the Microsoft.Azure.WebJobs.Extensions.Storage nuget package.

It turns out that I'm running the exact same versions of the SDK that GiddyUpHorsey is, following up on BrettSam's advice I try to update the CLI via Brew as per the docs and also via NPM as per this answer

However as you see here nothing works

Any ideas?

解决方案

Visual Studio for Mac 7 does not support using a Homebrew installation of Azure Functions Core Tools. Visual Studio for Mac 7 ships a copy of the tools and will only use those.

Visual Studio for Mac 8 does support this. It also has a built-in feature to update the templates and Azure Functions Core Tools itself, in a local directory, if it finds these are out of date. The Azure Functions team provide an online feed which Visual Studio for Mac will use. This update feature is available on creating a new Azure Functions project in the New Project.

If are using Visual Studio for Mac 7 you may be able to copy an updated version of the tools to the directory:

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

However I would take a backup of that directory or the entire Visual Studio.app first before trying to update those files so you can rollback if it does not work.

这篇关于无法在 Visual Studio Mac 中更新 Azure Functions 核心工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆