如何从Windows窗体创建EXE文件? [英] How do I create an EXE file from Windows Forms?

查看:82
本文介绍了如何从Windows窗体创建EXE文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#中有一个简单的项目。这是Windows窗体应用程序。

I have a simple project in C#. It's a Windows Forms application.

我希望能够将其转换为EXE文件,以便将其分发给我的一些朋友。我正在使用Visual Studio 2015。

I want to be able to make this into an EXE file to be able to give this out to some of my friends. I am using Visual Studio 2015.

在您说 bin / debug 文件夹中有一个应用程序文件之前, 对我知道那个。问题是我希望能够将其创建到一个文件中,使他们无法访问代码。

Before you say that there is an application file in the bin/debug folder, yes, I know that. The thing is that I want to be able to create this into just one file where they won't be able to access the code.

推荐答案

非常简单的步骤:


  1. 发布模式编译应用程序:

  1. Compile the application in Release mode:



  • Visual Studio:


  • .NET Framework MSBuild: msbuild.exe ConsoleApp1.sln / t:Build / p:Configuration = Release

  • .NET Core CLI: dotnet build -c版本(您可能需要配置项目以输出EXE)

    • Visual Studio:
    • .NET Framework MSBuild: msbuild.exe ConsoleApp1.sln /t:Build /p:Configuration=Release
    • .NET Core CLI: dotnet build -c Release (you may need to configure the project to output EXE)

      1. 打开解决方案文件夹

      2. 打开应用程序项目文件夹

      3. 打开 Bin 文件夹

      4. 打开 Release 文件夹

      5. 复制 .exe 文件

      6. 共享它。

      1. Open the solution folder
      2. Open the application project folder
      3. Open the Bin folder
      4. Open the Release folder
      5. Copy the .exe file
      6. Share it.

      这篇关于如何从Windows窗体创建EXE文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆