Reputation: 2187
Is there some way I can configure Visual Studio 2022 to use a specific version of the Azure Functions Core Tools and stop it from keep auto-updating the version?
So I've managed to run some earlier versions of func.exe
with earlier working builds of my code but I just keep getting error:
A host error has occurred during startup operation '00e57aab-bb85-42eb-8b4a-13e0c279b8ef'.
[2022-04-13T12:17:34.919Z] Microsoft.Azure.WebJobs.Extensions.DurableTask: Unable to find an Azure Storage connection string to use for this binding.
[2022-04-13T12:17:34.928Z] Using the default storage provider: AzureStorage.
Value cannot be null. (Parameter 'provider')
An update to VS2022 must have blown something low-level up in my local environment.
Upvotes: 2
Views: 7070
Reputation: 81
I have been updating an old function app that was running framework 2.2. Converted to 6.0 with fresh nugets including the Microsoft.NET.Sdk.Functions of 4.2.0 but it still runs Azure Functions Core Tools version 2.7.3188. I wanted to stick with Visual Studio. I had already downloaded the correct tools and installed them on my PC. However it didn't have any effect immediately. It finally started running the correct tools after a reboot. Also ensure that in your csproj you have the right AzureFunctionsVersion - for 4x tools have v4 etc:
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
This also could help:
<PropertyGroup>
...
<UseNETCoreGenerator>true</UseNETCoreGenerator>
</PropertyGroup>
Upvotes: 0
Reputation: 4776
You can pin to the specific version of Azure Functions core tools in the Visual Studio 2022. It will not let you auto update.
Whatever the recent version you installed, that will be picked by VS.
Example:
Here when you select .NET 6, it will create project on AFCT Version 4, if .NET 3, it will create project on AFCT Version 3 (v3).
But it will not update automatically. You can run .NET 3.1 project on v3 until there are any specific bindings or code requires update of AFCT Version 4.
It will just notify you there are some updates on Azure Functions Core Tools Package in your project/solution.
Note: AFCT - Azure Functions Core Tools
Whereas in VS Code, even though there are multiple versions of Azure Functions core Tools installed. At the beginning of project creation, you can select/pin the Specific Version of Azure Functions Core tools.
Later, it will notify there is an update on Azure Functions Core Tools Package that either you can accept update or ignore if you want to work on specified version.
Upvotes: 2