Azure-functions-vs-build-sdk: Could not load file or assembly System.Runtime, Version=5.0.0.0 for azure function v3 with net5.0

Created on 20 Jul 2020  路  4Comments  路  Source: Azure/azure-functions-vs-build-sdk

I have create an Azure function (HTTP trigger) with .NET 5.0.
Following the project config

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.3" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

I am also using DependencyInjection

using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

[assembly:FunctionsStartup(typeof(xxxx.Startup))]
namespace xxxx
{
    public class Startup : FunctionsStartup
    {
        public override void Configure(IFunctionsHostBuilder builder)
        {
           builder.Services.AddElasticsearch();
        }
    }
}

When running the function, I get following error

Could not load file or assembly 'System.Runtime, Version=5.0.0.0,

Most helpful comment

Please make self-contained deployments to azure functions supported out of the box, that will eliminate this painful yearly cycle where azure functions always lags months behind the general .net core / .net 5+ cycle.

All 4 comments

@rupeshtech .NET 5.0 is not currently supported by Azure Functions, hence the error.

@fabiocav Thanks for the response.

any idea, when can we expect support for .NET 5.0 by Azure functions.?

@rupeshtech we don't currently have an ETA, but that's something we're working on. Once we have a preview available, that will be posted in our announcements repo and usual channels (e.g. Twitter and blogs)

Please make self-contained deployments to azure functions supported out of the box, that will eliminate this painful yearly cycle where azure functions always lags months behind the general .net core / .net 5+ cycle.

Was this page helpful?
0 / 5 - 0 ratings