问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/55406677/unable-to-update-azure-functions-core-tools-in-visual-studio-mac