Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file or assembly System.Runtime, Version=5.0.0.0 for azure function v3 with net5.0 #451

Closed
rupeshtech opened this issue Jul 20, 2020 · 4 comments

Comments

@rupeshtech
Copy link

rupeshtech commented Jul 20, 2020

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,

@fabiocav
Copy link
Member

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

@rupeshtech
Copy link
Author

rupeshtech commented Aug 15, 2020

@fabiocav Thanks for the response.

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

@fabiocav
Copy link
Member

@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)

@jjxtra
Copy link

jjxtra commented Oct 17, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants