如何从命令行编译 NuGet 项目?

How do I compile a NuGet project from the command line?

我想在不使用 Visual Studio 的情况下编译带有 NuGet 依赖项的 C# 项目(太重了,无法再次下载)。我该怎么做?

例如,对于普通的 Rust 项目,我只需要 运行 cargo buildcargo rustc,所以我想知道如何使用基于 C#-NuGet 的项目来做到这一点解决方案(使用 paket)。

要添加更多上下文,paket 可以很好地下载依赖项,但我还不知道如何构建我的项目。我已经安装了 Mono,所以我 nuget 已经可以在这里使用了。

您基本上使用 MSBuild,Visual Studio 在后台使用它来构建您的应用程序。

查看文档 here. You can download it as a separate tool on your host machine and provide a path to your solution and run build. Here are the various build commands

NuGet 也一样。您可以从 here 下载 NuGet 命令行工具。创建一个基本的 PowerShell 脚本,您可以在其中 install/update 打包您的解决方案,然后使用 MSBuild 工具 运行 您的构建。