1

According to this article and this code sample with the v4 runtime, it's now possible to create an Azure Functions app using .NET Framework 4.8 with the isolated process model (it's in preview). I've done this, but I can't seem to launch or debug it in Visual Studio 2022. When I try, I get the message:

There is no Functions runtime available that matches the version specified in the project.

I assumed the version of the functions runtime was out of date on my computer, which it was. I had the 3.x version installed and so I updated it to 4.0.4736. Unfortunately, Visual Studio still won't launch my project. Is there a way to get this to work?

The entire csproj file looks like this:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <IsPackable>false</IsPackable>
    <TargetFramework>net48</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.8.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.1.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.7.0" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Properties\" />
  </ItemGroup>
</Project>
5
  • What version of visual studio do you have? (major, minor as well). You need the preview version of Visual Studio 17.4 for this to work. Commented Sep 16, 2022 at 17:38
  • I'm on 17.3.4, so that would make sense. I'll try installing that and see what happens. Commented Sep 16, 2022 at 18:55
  • I have tested in 17.3.2 VS 2022 and also in 17.3.4 VS 2022 but not worked, got the same error. Commented Sep 17, 2022 at 6:11
  • Same issue registered and closed in the GitHub but I'm unable to find the VS 2022 17.4 IDE to test the .NET 4.8 Function Solution, only VS 2022 17.4 Build Tools Preview Pack available Commented Sep 17, 2022 at 6:20
  • I have raised the issue to Microsoft in github :github.com/Azure/azure-functions-dotnet-worker/issues/1045 Commented Sep 17, 2022 at 10:19

2 Answers 2

3

I found this post while figuring out this issue as well. The issue as reported and linked above by @HariKrishna was closed on GitHub, but it did contain the link to the solution that helped me:

https://github.com/Azure/azure-functions-dotnet-worker/issues/989

VS needs to be updated to at least 17.4 (preview) and after that the Azure function tools needs to be updated through Tools, Options, Projects and Solutions, Azure functions, Click Check for updates, then click Download & install.

Sign up to request clarification or add additional context in comments.

1 Comment

Important detail - after following the steps above a new option will be available when a creating a Function project, as shown in github.com/Azure/azure-functions-dotnet-worker/issues/…
0

On Azure Functions v4 .NET Framework 4.8 with the VS 2022 17.3.4 version, I too got the same errors as:

There is no Functions runtime available that matches the version specified in the project.

I have raised the issue in the GitHub Repo of Azure Functions dotnet worker but with the preview versions of package references in the .csproj file, it didn't' worked for me.

It worked with the below configuration code:

.csproj:

Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>net48</TargetFramework>
        <AzureFunctionsVersion>v4</AzureFunctionsVersion>
        <OutputType>Exe</OutputType>
    </PropertyGroup>
    <ItemGroup>
        <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.8.0" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.7.0" />
    </ItemGroup>
    <ItemGroup>
        <None Update="host.json">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Update="local.settings.json">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
            <CopyToPublishDirectory>Never</CopyToPublishDirectory>
        </None>
    </ItemGroup>
    <ItemGroup>
        <Folder Include="Properties\" />
    </ItemGroup>

local.settings.json:

{
    "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
  }
}

HttpFunction.cs Function Code is taken from the same GitHub Repository.

Result:

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.