简体   繁体   English

如何从 Visual Studio 项目创建可执行文件

[英]How To Create An Executable from Visual Studio Project

So currently I have a project in Visual Studio that runs perfectly.所以目前我在 Visual Studio 中有一个运行完美的项目。 When I build the project and create the.exe build in my Debug folder I can run it without any problems.当我构建项目并在我的 Debug 文件夹中创建 .exe 构建时,我可以毫无问题地运行它。 However, when I try to share my.exe build with other co-workers the project doesn't run and crashes.但是,当我尝试与其他同事共享 my.exe 构建时,该项目不会运行并崩溃。 At first the project described that the dependencies weren't able to be located.起初,该项目描述了无法找到依赖项。 I then added the dependencies to the folder where the.exe program was located and it still doesn't work.然后我将依赖项添加到.exe程序所在的文件夹中,它仍然无法正常工作。

So what is the best way to create a.exe program that I can hand out to people?那么创建一个我可以分发给人们的.exe程序的最佳方法是什么? And is there a way to test the program in an "outside" environment on my computer?有没有办法在我的计算机上的“外部”环境中测试程序? Is there a way to create a.exe program that's not located in my debug folder?有没有办法创建不在我的调试文件夹中的.exe 程序?

Give them the whole debug folder with the exe.用 exe 给他们整个调试文件夹。 It should work.它应该工作。 To have less files and optimization from the compiler use release instead of debug mode.要从编译器获得更少的文件和优化,请使用发布而不是调试模式。 Give them the release folder in this case.在这种情况下,给他们发布文件夹。

If you want even less files install the nuget package fody costura which will pack all.dll into the exe如果您想要更少的文件,请安装 nuget package fody costura,它将 all.dll 打包到 exe 中

If you want to create an installer, check out click once deployment.如果要创建安装程序,请查看单击一次部署。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 Visual Studio 创建可执行文件 - Create Executable from Visual Studio 如何使用 Visual Studio Code 创建新的可执行 C# 项目 - How to create a new executable C# project with Visual Studio Code 从项目文件中构建不带Microsoft Visual Studio的可执行文件 - Build an executable file without Microsoft Visual Studio from project file 如何从一个Visual Studio项目创建两个不同的可执行文件 - How to create two different executables from one Visual Studio project 如何在 Visual Studio 2008 中创建单个可执行文件? - How to create a single executable file in Visual Studio 2008? 如何在Visual Studio 2015中创建可执行文件 - How do I create an executable in Visual Studio 2015 如何在Visual Studio项目中创建命令/实用程序 - How to create commands/utilities in a visual studio project 如何从Visual Studio C#可执行文件中删除修订版号? - How to remove revision number from Visual Studio C# executable? 如何在Visual Studio 2013 Express中将“可执行项目作为启动项目”设置? - How do I set the “executable project as the startup project” in Visual Studio 2013 Express? 如何从Visual Studio 2012项目降级到Visual Studio 2008 - How to downgrade from Visual Studio 2012 project to Visual Studio 2008
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM