如何从源代码构建 .NET SDK [英] How to build .NET SDK from source
问题描述
如何从源代码编译 .NET SDK?当我运行 build.sh 时,我收到一条消息,提示正在下载包(我不明白为什么,因为目标是编译).下载时出现 404 错误,然后是:
dotnet_install:错误:找不到/下载:`.NET Core Runtime` 版本 = 1.0.5dotnet_install:错误:有关 .NET Core 支持的信息,请参阅:https://aka.ms/dotnet-os-lifecycle
当我运行 build.sh 时,我收到一条消息说正在下载包(我不明白为什么,因为目标是编译)
这很正常.您正在尝试编译 SDK,它本身是用 C# 编写的.您需要一个 C# 编译器(例如 .NET SDK 中包含的编译器)来编译 SDK 本身.
这与需要 C/C++ 编译器构建的 C/C++ 编译器(例如 gcc)没有太大区别.
我想最大的区别是自动下载所需的编译器,而不是失败并要求用户手动安装编译器.
<块引用>dotnet_install:错误:无法找到/下载:`.NET Core Runtime` 版本 = 1.0.5dotnet_install:错误:有关 .NET Core 支持的信息,请参阅:https://aka.ms/dotnet-os-lifecycle
这绝对是 SDK 构建系统中的一个错误.我看到你在这里报告了它:https://github.com/dotnet/sdk/issues/14966.这需要由 SDK 开发人员修复.
How to compile .NET SDK from source? When I run build.sh, I get a message that the package is being downloaded (I don't understand why, since the goal is to compile). I get a 404 error while downloading and then this:
dotnet_install: Error: Could not find/download: `.NET Core Runtime` with version = 1.0.5
dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support
When I run build.sh, I get a message that the package is being downloaded (I don't understand why, since the goal is to compile)
That's normal. You are trying to compile the SDK, which is itself written in C#. You need a C# compiler (such as the one included in the .NET SDK) to compile the SDK itself.
That's not too different from a C/C++ compiler (such as gcc) requiring a C/C++ compiler to build.
I guess the biggest difference is that the required compiler is downloaded automatically instead of failing and asking the user to install the compiler manually.
dotnet_install: Error: Could not find/download: `.NET Core Runtime` with version = 1.0.5 dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support
That's definitely a bug in the SDK build system. I see that you have reported it here: https://github.com/dotnet/sdk/issues/14966. This needs to be fixed by the SDK developers.
这篇关于如何从源代码构建 .NET SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!