正确的 .NET Core SDK 来构建 netstandard20 库

发布于 2025-01-20 19:14:19 字数 920 浏览 3 评论 0原文

我有一些具有目标框架的库NetStandard20。这些库由几个.NET Framework 4.6.1库消费。

由于某些安全漏洞,IT部门从构建服务器中卸载了 .NET Core 2.0 。使用NetStandard20的所有库现在都失败了以下错误:

c:\ bamboo6104 ...> nuget Restore MSBUILD自动检测:使用'C:\ Program Files(X86)\ Microsoft Visual Studio \ 2019 \ buildTools \ MSBUILD \ MSBUILD \ Current \ Current \ bin'使用MSBUILD版本'16 .11.2.50704'。 c:\ bamboo6104 \ xml-data \ build-dir \ bam-cus-job1 ... \ netStandard \ xxx.csproj:错误msb4236:SDK'ICROSOFT.NET.NET.NET.SDK'指定的指定。

该构建服务器已经具有 Visual Studio 2019 。需要安装哪种版本的SDK才能通过?我的笔记本电脑上有以下SDK:

”“在此处输入图像说明”

是否会安装 2.1.526 版本可以解决构建问题?

由于我们有许多具有相同问题的库,因此我无法将库升级为.NET 5或6,而升级不是优先事项。

I have a few libraries with target framework netstandard20. These libraries are consumed by a few .net framework 4.6.1 libraries.

The IT department uninstalled the .NET Core 2.0 from the build server because of some security vulnerability. All the libraries that use netstandard20 are now failing with the following error:

C:\bamboo6104...>nuget restore
MSBuild auto-detection: using msbuild version '16.11.2.50704' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\bin'.
C:\bamboo6104\xml-data\build-dir\BAM-CUS-JOB1...\netstandard\xxx.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

The Build Server already has Visual Studio 2019. What version of SDK need to be installed for the build to pass? I have the following SDKs on my laptop:

enter image description here

Will installing 2.1.526 version resolve the build issue?

I can't upgrade the libraries to .NET 5 or 6 due to we have numerous libraries with the same problem and upgrade is not a priority.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文