.net - 将 .NET 控制台应用程序编译为单个可执行文件

标签 .net visual-studio compilation f#

我有一个用 F# 编写的面向 .NET Framework 4.6.2 的控制台应用程序。我构建的工件是 MyApp.exe 和 FSharp.Core.dll。本页https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-options建议 —-standalone 标志应该允许我生成一个独立的 MyApp.exe。如何在 Visual Studio (2017) 中或通过其他方式做到这一点?

最佳答案

在 Visual Studio 中,您可以右键单击项目,转到属性并在“其他标志”中指定 --standalone。以下截图来自 VS2015,但我认为这在 VS2017 中看起来是一样的。

此外,如果您同时使用 Debug 和 Release 版本,则需要为它们指定此项。

enter image description here

关于.net - 将 .NET 控制台应用程序编译为单个可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50157636/

相关文章:

c# - 列表<T>排序内存泄漏

c# - 我应该在 C# 中选择哪个通用集合来维护排序的 "list"

c# - ENC1003 C# 在应用程序运行时不会应用在项目中所做的更改

android - VS Android 模拟器问题。 "Preparing virtual machine..."

compilation - 如何在 LLVM 中查找一条指令是否支配另一条指令?

c++ - 从 Visual Studio 运行 Simulink 模型时出现编译器错误

c# - 将十六进制字符串转换回字符

.net - 在 Linux Mint 19 上安装 dotnet 核心

visual-studio - Visual Studio 安装程序中的哪个 "Individual Component"适合 Rust 开发?

c++ - 架构 x86_64 : Compiling problems 的 undefined symbol