Search code examples
visual-studioazureazure-functions.net-framework-versionazure-functions-runtime

Azure Function App won't run on Visual studio 2017 Requiring .NET Framework 4.7.1


I had my Azure function running by yesterday but after updating windows to Version 17755.1 the app fails to run with n error requesting .NET Framework version 4.7.1 to be installed. I have counterchecked on my pc and actually the .NET Framework version 4.7.1 is installed. I tried to install the it from here but it won't install.

Error on running app

Error on trying to install .net framework


Solution

  • That build of Windows appears to have a general issue running any .NET app that targets 4.7.1.

    Here is a workaround:

    • Go to %LOCALAPPDATA%\AzureFunctionsTools\Releases\[cliversion]\cli
    • Edit func.exe.Config
    • Change the supportedRuntime tag to target 4.7.2 instead of 4.7.1

      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />