В чем разница между SDK и средой выполнения в .NET Core?
Я прочитал много статей, в том числе эту , но до сих пор не могу понять, в чем разница, а они не объяснили это ни простым языком, ни вообще.
Может кто-нибудь пояснить, в чем разница между .NET SDK и .NET Runtime?
Обновление: было бы очень полезно использовать сравнения. Аналогия с простым английским очень поучительна.
Согласно руководству .Net Core , .NET Core состоит из следующих элементов.
- A .NET runtime, which provides a type system, assembly loading, a garbage collector, native interop and other basic services.
- A set of framework libraries, which provide primitive data types, app composition types and fundamental utilities.
- A set of SDK tools and language compilers that enable the base developer experience, available in the .NET Core SDK.
- The ‘dotnet’ app host, which is used to launch .NET Core apps. It selects the runtime and hosts the runtime, provides an assembly loading policy and launches the app. The same host is also used to launch SDK tools in much the same way.
SDK — это все, что необходимо / упрощает разработку приложения .NET Core, например интерфейс командной строки и компилятор.
Среда выполнения — это «виртуальная машина», на которой размещается / запускается приложение и абстрагируется все взаимодействие с базовой операционной системой.
Только последнее требуется для запуска приложения, но первое необходимо для разработки приложения.
Время выполнения : для запуска приложений
SDK (Runtime + Tooling) : для создания и запуска приложений
Я здесь ничего не придумываю. Просто скопируйте и вставьте определения с https://dotnet.microsoft.com/download

The software development kit (SDK) includes everything you need to build and run .NET Core applications, using command-line tools and any editor (like Visual Studio).
The runtime includes everything you need to run .NET Core applications. The runtime is also included in the SDK.


Для запуска приложения требуется только среда выполнения .NET Core, которая предоставляет информацию об установке.
Для разработки, сборки и публикации приложения потребуется SDK.
dotnet.exe installs with a runtime install, but it only provides core features to provide info to run an application and provide info about the install: dotnet mydll.dll and dotnet —info . To build, publish or do anything else you need to install the SDK.
Running the following command will provide information about the install:
Если команда не работает, это означает, что у вас не установлена или недоступна среда выполнения .NET Core в системном PATH.
Ниже приведен пример вывода команды.
- The installed SDK version
- The active runtime version that’s running this dotnet command
- A list of all installed runtimes and SDKs
При установке SDK также устанавливается среда выполнения.
специфично для macOS homebrew
Установка dotnet homebrew- cask будет конфликтовать с dotnet-sdk , поэтому, чтобы получить как среду выполнения, так и sdk, установите dotnet-sdk
Короче говоря, среда выполнения позволит вашей ОС запускать скомпилированные программы C-Sharp , C # , а sdk позволит вам компилировать программы, написанные на C-Sharp , C # .
It’s important to understand that you can have multiple runtimes and multiple SDKs installed and each project can use a different one. The runtime is determined by your project’s runtime specifier in the .csproj file:
dotnet / runtime Goto Github PK
.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
License: MIT License
Batchfile 0.03% Shell 0.15% PowerShell 0.05% CMake 0.13% Python 0.18% C# 82.41% C++ 9.31% C 6.74% Perl 0.01% Assembly 0.29% Yacc 0.03% Makefile 0.01% Roff 0.13% Smalltalk 0.01% XSLT 0.09% HTML 0.01% OpenEdge ABL 0.03% Dockerfile 0.01% Visual Basic .NET 0.39% Objective-C 0.01%
runtime’s Introduction
This repo contains the code to build the .NET runtime, libraries and shared host ( dotnet ) installers for all supported platforms, as well as the sources to .NET runtime and libraries.
-
(with VS, VS Code, command-line CLI) (Get Started, Tutorials, Porting from .NET Framework, API reference, . )
How can I contribute?
We welcome contributions! Many people all over the world have helped make this project better.
-
explains what kinds of contributions we welcome
-
explains how to build and test
-
explains how to get nightly builds of the runtime and its libraries to test them in your own projects.
Reporting security issues and security bugs
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [email protected] . You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.
This repo should contain issues that are tied to the runtime, the class libraries and frameworks, the installation of the dotnet binary (sometimes known as the muxer ) and installation of the .NET runtime and libraries.
For other issues, please use the following repos:
- For overall .NET SDK issues, file in the dotnet/sdk repo
- For ASP.NET issues, file in the dotnet/aspnetcore repo.
-
/ .NET Framework source index (incl. APIs from daily builds and API usage info) — useful when writing /// comments — a place to talk and hang out with .NET community
.NET Runtime is a .NET Foundation project.
There are many .NET related projects on GitHub.
-
— links to 100s of .NET projects, from Microsoft and the community. — the best place to start learning about ASP.NET Core.
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.
.NET (including the runtime repo) is licensed under the MIT license.
runtime’s People
Contributors
Stargazers
Watchers
Forkers
runtime’s Issues
An OleDbCommand.Prepare() method throws the System.Data.OleDb.OleDbException: 'The parameter is incorrect.' exception
The following code under the .NET Core 3 causes the System.Data.OleDb.OleDbException: ‘The parameter is incorrect.’ exception, but under .NET Framework, it works fine:
Code
Call Stack
AllConfigurations leg is broken in master for netcoreapp3.0
Doing a .\build.cmd -allconfigurations build fails with RAR not being able to resolve assemblies for netcoreapp3.0. I checked the logs and binplacing isn’t doing anything.
Strange enough, this doesn’t happen in CI. Same behavior in CoreFx.
Add root build definition which builds the entire repo
Overview
The purpose of this comment is to give a design of the CI build of dontet/runtime using the live builds of each folder under src. This replace the old package restore dependency flow between what used to be dotnet/coreclr , dotnet/corefx and dotnet/core-setup .
It is important to note that this focuses on the CI build of the dotnet/runtime product. This distinction is required because the developer worklow for the repository is different and is being added here: #55.
We want to have a single pipeline that builds a minimum matrix of coreclr, libraries and installer for all paths in the repository excluding docs/* .
The simple justification is that our setup already mostly requires this. Coreclr changes have to build libraries to run tests. Libraries has to build CoreCLR to build and to run tests once we’re live / live. The only real delta here is whether or not to build installers. That can be done in parallel with testing though hence it doesn’t affect throughput.
The approach would be to condition a full platform matrix and condition test runs based on changed paths. There would be an early job which defines variables (i.e changedLibraries , changedCoreClr ) and then we would condition build and test jobs based on those variables.
The downside to this approach is that a bunch of jobs will be shown as skipped when the path doesn’t applies, but long-term we can request a feature that defines a variable at compile time with the changed paths and then we can condition at compile time rather than run time.
The advantages is that now we have less .yml entry-points to maintain and we avoid a lot of build duplication on our CI when a change touches multiple subsets.
Building
runtime/src/coreclr and runtime/src/corefx should each have templates which allow the following parameters, platforms: [<OS>_<Arch>] , buildConfig [debug, checked, release] , jobTemplate.
This will allow us to re-use the platform fan out template logic for the coreclr and libraries steps build.
This is about to be done for coreclr and libraries (#294 and #274).
Pipeline mock up
- Official Build:
build coreclr -> build libraries -> build installer -> sign -> publish - changedCoreClr == true:
build coreclr (full matrix including checked builds) -> build libraries -> build libraries tests, build coreclr managed tests, build coreclr native tests -> run tests - changedLibraries == true:
build coreclr -> build libraries -> build libraries tests -> run libraries tests - changedInstaller == true:
build coreclr -> build libraries -> build installer -> build installer tests -> run installer tests
React to expected Arcade change: removing some channels
The installer build depends on the list of channels, so we have to react:
Lines 214 to 229 in 666923a
| # Publish channel configuration. The publish template wraps Arcade publishing and adds some |
| # extras that aren’t implemented in Arcade yet. |
| # |
| # — dependsOn: <ID of the Arcade stage that finalization should run after> |
| # channel: |
| # name: <Name of this channel, for logging and readability> |
| # bar: <Name of the Arcade variable that contains the ID of this channel in BAR> |
| # storage: <Name of the Latest channel to publish to in dotnetcli blob storage> |
| dependsOnPublishStages : |
| — dependsOn : NetCore_Release30_Publish |
| channel : |
| name : .NET Core 3 Release |
| bar : PublicRelease_30_Channel_Id |
| storage : release/3.0-preview9 |
| public : true |
@mmitche will be removing the release channels from the templates in master Arcade.
We don’t need to wait for the arcade change, it’s fine to have channels exist with no entry in the installer build’s mapping, there just won’t be custom steps run on them if they happen to get assigned.
coreclr build failure: "GetTargetMachineInfo" task could not be loaded
With a new, clean runtime clone, src\coreclr\build.cmd fails with:
RsaSignaturePadding equality comparison is infinitely recursive
The existing code has a non-obvious infinite recursion when two non-null RSAEncryptionPadding object instances are compared for equality.
(1) is obviously calling (2), but it is not obvious that (2) is calling (3) and then calling back to (1), this will eventually overflow the stack.