简体   繁体   English

无法从程序集“System.Runtime、Version=4.2.2.0、Culture=neutral、PublicKeyToken=b03f5f7f11d50a3a”加载类型“System.Environment”

[英]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.

相关问题 .Net Core 3.1 Function 应用程序单元测试尝试查找 System.Runtime 4.2.2.0 失败 - .Net Core 3.1 Function App Unit Test Fails trying to find System.Runtime 4.2.2.0 C# AWS Lambda Function - 找不到文件名为“LambdaTest、Culture=neutral、PublicKeyToken=null”的指定处理程序程序集 - C# AWS Lambda Function - Could not find the specified handler assembly with the file name 'LambdaTest, Culture=neutral, PublicKeyToken=null' 汇编中跳转指令中的 f 和 b 符号 - f and b symbol in jump instructions in assembly Azure function v4 迁移。 无法加载文件或程序集 'Microsoft.Extensions.Configuration.Abstractions,Version=7.0.0.0,Culture=neutral - Azure function v4 migration. Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=7.0.0.0, Culture=neutral 无法加载文件或程序集 'System.ComponentModel,版本 = 5.0.0.0 - Could not load file or assembly 'System.ComponentModel, Version=5.0.0.0 从 Unity 2021.3.13f 更新到 2021.3.14f 时库 System.Security.Permissions 和 mscorlib 发生冲突 - Conflicting libraries System.Security.Permissions and mscorlib when updating from Unity 2021.3.13f to 2021.3.14f System.IO.FileNotFoundException:无法加载文件或程序集 'Microsoft.EntityFrameworkCore,版本 = 2.2.0.0, - System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.2.0.0, Azure 函数错误 - 无法加载文件或程序集 System.Configuration.ConfigurationManager,版本 = 4.0.3.0 - Azure Functions Errro - Could not load file or assembly System.Configuration.ConfigurationManager, Version=4.0.3.0 System.BadImageFormatException:无法加载文件或程序集(来自 installutil.exe) - System.BadImageFormatException: Could not load file or assembly (from installutil.exe) System.IO.FileLoadException - 无法加载文件或程序集 Microsoft.WindowsAzure.Storage - System.IO.FileLoadException - Could not load file or Assembly Microsoft.WindowsAzure.Storage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM