[英]Create an exe on publish in a .NET core project in VS2017
I created a console application in .NET Core 2 and wanted to make it an executable file (so I don't have to launch it via Visual Studio 2017). 我在.NET Core 2中创建了一个控制台应用程序,并希望使其成为可执行文件(因此我不必通过Visual Studio 2017启动它)。 The problem is that publishing the file into a local folder does not do that, there are DLL files, but no EXE. 问题在于,将文件发布到本地文件夹不会这样做,因为有DLL文件,但没有EXE。
I know how to do it when creating a .NET Core Console application by command line . 通过命令行创建.NET Core控制台应用程序时,我知道该怎么做 。 I created a separate simple project and used 我创建了一个单独的简单项目,并使用了
dotnet build -r win10-x64
My problem is that I want to publish my application from Visual Studio 2017. I'm trying to achieve that but with no results. 我的问题是我想从Visual Studio 2017发布我的应用程序。我正在尝试实现这一目标,但没有结果。 How can I do that? 我怎样才能做到这一点?
Command Line 命令行
dotnet publish -c release -r win10-x64
Replace win10-x64
with any other supported platform identifier 用任何其他受支持的平台标识符替换win10-x64
VS2017 VS2017
<RuntimeIdentifiers>linux-x64;win7-x64</RuntimeIdentifiers>
to some <PropertyGroup />
in the .csproj
file with a list of extra identifiers. 要将更多选项添加到列表中,请将<RuntimeIdentifiers>linux-x64;win7-x64</RuntimeIdentifiers>
到具有附加标识符列表的.csproj
文件中的某些<PropertyGroup />
中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.