c# - 在 project.json 的 .NET Core 中选择 .dll 和 .exe

标签 c# .net .net-core

如何在 .NET Core 的新项目格式中选择 .dll 和 .exe 作为项目的输出类型?

最佳答案

project.json 文件中的选项是emitEntryPoint

"buildOptions": {
    "emitEntryPoint": true
}

这会在控制台应用程序 .exe (true) 和库 .dll (false) 之间切换。

启用此选项后,应用程序必须具有 public static void Main()

参见:Answer about emitEntryPoint meaning

关于c# - 在 project.json 的 .NET Core 中选择 .dll 和 .exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37853979/

相关文章:

c# - 我的强连接组件算法出错

C# SortedDictionary 产生异常结果

c# - LIST_ENTRY 和 UNICODE_STRING pinvoke C#

c# - 显示页码

c# - WPF TextBox 在 Tab 焦点上全选

azure - .NET Core 2.1 Azure Functions 不会在 Azure Pipelines 中构建

c# - 使用 Odbc C# .Net 连接到 Pick 数据库

c# - 如何在 C#、.net 中异步重定向标准错误流而不是进程的标准输出流

c# - 等效于 WPF .NET 5、.NET 6 或 .Net Core 中的 UserSettings/ApplicationSettings

asp.net - 可以在 .NET Framework 和 .NET Core 之间共享的类库