运行时是否需要 .NET Core SDK?

Is the .NET Core SDK required for runtime?

我正在设置 Ubuntu 机器以根据说明 here 部署 Asp.Net MVC Core 应用程序。在其中,它要求安装 .NET Core SDK。

如果我的服务器只是 运行 Web 应用程序,是否需要安装 SDK?

此外,如果我的应用程序是在 Visual Studio 中使用 .NET Core 3.0 开发的,可以在 运行 时使用 .NET Core 3.1 吗?

来自文档;

Install the SDK (which includes the runtime) if you want to develop .NET Core apps. Or, if you only need to run apps, install the runtime. If you're installing the runtime, we suggest you install the ASP.NET Core runtime, as it includes both .NET Core and ASP.NET Core runtimes.

因此,如果您只需要 运行 个应用程序,则无需安装 SDK。

您需要安装与您的项目 (SDK) 版本相同的 运行time 版本

运行时足以 运行 部署的应用程序 https://dotnet.microsoft.com/download/dotnet-core/3.1 事实上,您甚至不必这样做。因为你也可以发布自包含包 https://docs.microsoft.com/pl-pl/dotnet/core/deploying/#publish-self-contained 这将携带 运行在目标 OS

上构建您的应用程序所需的所有资源

v3.1 运行时间应该支持你在 v3.0 中构建的应用程序