[英]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?
有人遇到过这个问题吗?
[ [
[ [
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 的迁移,我们需要确保删除对旧框架的引用
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.