简体   繁体   English

如何将 Azure Functions v3 迁移到 .net core 5.0

[英]How to migrate Azure Functions v3 to .net core 5.0

I have upgraded all assemblies in an Azure Function v3 project to version 5.0 but I am unable to run the function.我已将 Azure Function v3 项目中的所有程序集升级到版本 5.0,但我无法运行该函数。 Here it is my function's csproj file's partial definition:这是我函数的 csproj 文件的部分定义:

<PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.3" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.11" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.SignalRService" Version="1.2.2" />
    <PackageReference Include="System.Net.Http" Version="4.3.4" />
  </ItemGroup>

What's the necessary workaround to make this function with .NET 5?使用 .NET 5 实现此功能的必要解决方法是什么? Google did not yield anything conclusive.谷歌没有得出任何结论。

Further info: 5.0.100 [C:\\Program Files\\dotnet\\sdk]更多信息:5.0.100 [C:\\Program Files\\dotnet\\sdk]

This is one of the error messages that I get:这是我收到的错误消息之一:

Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.无法加载文件或程序集“Microsoft.Extensions.Configuration.Abstractions,Version=5.0.0.0,Culture=neutral,PublicKeyToken=adb9793829ddae60”。 The system cannot find the file specified.该系统找不到指定的文件。

The comment by @Marc is correct, currently Azure Functions do not support .net 5. Current ETA is a preview by end of year. @Marc 的评论是正确的,目前 Azure Functions 不支持 .net 5。当前的 ETA 是年底的预览。

Please keep an eye on this github issue for any updates.请密切关注此 github 问题以获取任何更新。

Azure functions team released support for .Net 5 by introducing a new isolated process model to run .NET function apps. Azure 函数团队通过引入新的隔离进程模型来运行 .NET 函数应用程序,发布了对.Net 5的支持。

You can read more about this in the announcement .您可以在公告中阅读更多相关信息。

To migrate you function app to .Net 5 you can follow this guide .要将您的函数应用迁移到.Net 5您可以按照本指南进行操作

Dave Brock created a web page explaining the process using the preview bits. Dave Brock 创建了一个网页,解释了使用预览位的过程。 But I believe it should be close enough for the release bits.但我相信它应该足够接近发布位。 See here .这里

Looks like Brandon Minnick's guide is more comprehensive.看起来 Brandon Minnick 的指南更全面。 See here .这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM