简体   繁体   English

TFM 从 netcoreapp3.0 升级到 netcoreapp3.1 时 Azure Function 构建失败

[英]Azure Function fails to build when TFM is upgraded from netcoreapp3.0 to netcoreapp3.1

We were trying to bump our dotnet version from a mix of .net 2.2 & .net core 3.0 to .net core 3.1 and we followed Jeff Holan's Dev post to upgrade which is surmarised as below我们试图将我们的 dotnet 版本从 .net 2.2 和 .net 核心 3.0 的组合提升到 .net 核心 3.0 到 .net 核心 3.1 的混合版本,我们在升级后遵循了 Jeffsurmaran 3.1 之后的设计。

To change a project between ~2 and ~3 locally, update the.csproj file of the project and change: AzureFunctionsVersion from v2 to v3 Microsoft.NET.Sdk.Functions package version to at least 3.0.1 Optionally, you can change to target netcoreapp3.1 if you want to target the latest .NET Core version要在本地更改 ~2 和 ~3 之间的项目,请更新项目的 .csproj 文件并将: AzureFunctionsVersion 从 v2 更改为 v3 Microsoft.NET.Sdk.Functions package 版本至少更改为目标 3.0.1 netcoreapp3.1 如果要针对最新的 .NET 核心版本

But while debugging Azure function project locally in VS Code, it still failed with an error message suggesting that there were still config remnants pointing to 3.0.但是在 VS Code 中本地调试 Azure function 项目时,它仍然失败并显示错误消息,提示仍然存在指向 3.0 的配置残余。 Anyone encountered this issue?有人遇到过这个问题吗?

[ [VS Code Azure 函数扩展错误码]

[ [csproj + 任务主机运行日志]

On doing a full project search, we found that VS Code itself stored [ie in its.vscode directory], namely in two files: settings.json and tasks.json.在进行完整的项目搜索时,我们发现 VS Code 本身存储在[即在其.vscode 目录中],即在两个文件中:settings.json 和 tasks.json。 Some config key value pairs still pointed to .net core 3.0 [perhaps these were added during when we were debugging the project when these were the current framework].一些配置键值对仍然指向 .net 核心 3.0 [也许这些是在我们调试项目时添加的,当时这些是当前框架]。 So for the migration from 2.2/3.0 to 3.1 we need to to ensure the references to the older frameworks are removed因此,对于从 2.2/3.0 到 3.1 的迁移,我们需要确保删除对旧框架的引用

设置.json

任务.json

  1. We have to explicitly make the changes in tasks.json from netcoreapp3.0 to netcoreapp3.1我们必须在 tasks.json 从 netcoreapp3.0 到 netcoreapp3.1 中显式地进行更改

对 tasks.json 的差异更改

  1. Ensure the deploy path in settings.json points to .net core 3.1确保设置中的部署路径。json 指向 .net 核心 3.1 .vscode 下 settings.json 的差异变化

PS: In settings.json, project runtime is bumped upto 3 if you have followed Jeff Hollans dev article, otherwise it will mostly point to ~2 PS:在 settings.json 中,如果您遵循 Jeff Hollans 的开发文章,项目运行时间会增加到 3,否则它将主要指向 ~2

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

相关问题 Azure DevOps 管道在恢复时失败 - 测试项目与 netcoreapp2.2 不兼容项目支持:netcoreapp3.0 - Azure DevOps pipeline fails at Restore - Test project is not compatible with netcoreapp2.2 Project supports: netcoreapp3.0 将目标从 netcoreapp3.0 更改为 netstandard2.1 时缺少 TableAttribute - TableAttribute is missing when change target from netcoreapp3.0 to netstandard2.1 VS2019 错误说项目在定位 netcoreapp2.2 时定位到“netcoreapp3.1” - VS2019 Error Says Project is Targetting 'netcoreapp3.1' when it is Targetting netcoreapp2.2 CsvHelper package:.netcoreapp3.0 不支持? - CsvHelper package: .netcoreapp3.0 not supported? Package X 与 netcoreapp3.1 不兼容 - Package X is not compatible with netcoreapp3.1 库构建 with.netcoreapp3.1 在尝试在多个框架上运行测试的 GitHub 操作上抛出错误 - Library build with netcoreapp3.1 throws errors on GitHub actions trying to run tests on multiple frameworks 使用 netcoreapp3.0 安装 dotnet-ef 时遇到问题 - Facing Issue while Installing dotnet-ef with netcoreapp3.0 约束引用“字符串”无法解析为类型。 (netcoreapp3.0) - The constraint reference 'string' could not be resolved to a type. (netcoreapp3.0) 使用 VS2019 构建控制台 .netcoreapp3.1 应用程序时出错 - Error building a console .netcoreapp3.1 app with VS2019 如何强制 Swashbuckle.Aspnetcore.Cli 使用 netcoreapp3.1? - How to force Swashbuckle.Aspnetcore.Cli to use netcoreapp3.1?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM