[英]Could not load type 'System.Environment' from assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
We are updating from .NET 3.1 to .NET 6. After deploying the Azure Function App, the "Runtime version" displays, "Error", and the below message is on the overview page.我们正在从 .NET 3.1 更新到 .NET 6. 部署 Azure Function 应用程序后,“运行时版本”显示“错误”,并且在概览页面上显示以下消息。
Could not load type 'System.Environment' from assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
无法从程序集“System.Runtime、Version=4.2.2.0、Culture=neutral、PublicKeyToken=b03f5f7f11d50a3a”加载类型“System.Environment”。
The solution is to update the function app to version 4.解决方案是将 function 应用程序更新到版本 4。
Updating the following project values to:将以下项目值更新为:
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
and和
Using this command: az functionapp config appsettings set --settings FUNCTIONS_EXTENSION_VERSION=~4 -n <APP_NAME> -g <RESOURCE_GROUP_NAME>
使用此命令:
az functionapp config appsettings set --settings FUNCTIONS_EXTENSION_VERSION=~4 -n <APP_NAME> -g <RESOURCE_GROUP_NAME>
source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions?tabs=in-process%2Cv4&pivots=programming-language-csharp#migrating-from-3x-to-4x来源: https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions?tabs=in-process%2Cv4&pivots=programming-language-csharp#migrating-from-3x-to-4x
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.