简体   繁体   English

Visual Studio Express 2012不在Release文件夹中构建exe

[英]Visual Studio Express 2012 not building exe in Release folder

I have compiled a simple 'Hello World' program. 我编写了一个简单的“Hello World”程序。 The program is successfully compiled without any errors. 程序编译成功,没有任何错误。 I can see a working executable in bin folder. 我可以在bin文件夹中看到工作的可执行文件。 But the Release folder of the project is totally empty. 但该项目的Release文件夹完全是空的。

I don't know if there is any settings problem or any problem in building. 我不知道是否有任何设置问题或建设中的任何问题。 Apparently, I don't see any error. 显然,我没有看到任何错误。

You can change your build mode in top of your Visual Studio: 您可以在Visual Studio的顶部更改构建模式:

在此输入图像描述

Dependently on which mode you build your solution, Visual Studio will generate .exe in either bin\\Debug folder or bin\\Release folder. 根据您构建解决方案的模式,Visual Studio将在bin\\Debug文件夹或bin\\Release文件夹中生成.exe。

Make sure you're building the release version, not the debug version. 确保您正在构建发行版本,而不是调试版本。 By default, VS will build a Debug build, which will go into the bin\\Debug folders. 默认情况下,VS将构建一个Debug构建,它将进入bin\\Debug文件夹。

For details, see How to: Set Debug and Release Configurations . 有关详细信息,请参见如何:设置调试和发布配置

More expanded explanation: 更广泛的解释:

Your output directory of executable file is specified by default to [your_project_directory]\\bin\\Debug for Debug build mode or to [your_project_directory]\\bin\\Release for Release build mode 您的可执行文件的输出目录默认指定为[your_project_directory] ​​\\ bin \\ Debug for Debug build mode或[your_project_directory] ​​\\ bin \\ Release for Release build mode

  • your_project_directory - place where is created your project (there is located *.csproj file) your_project_directory - 创建项目的位置(位于* .csproj文件中)

To switch between default directories Debug/Release use solution proposed here . 要在默认目录之间切换 Debug / Release使用此处提出的解决方案。

But if you want specify your own output directory , follow these steps: 但是,如果要指定自己的输出目录 ,请按照下列步骤操作:

  1. Go to Project -> [MyProjectName] Properties... (or type Alt+F7) and in properties window switch to Build tab (from left panel) 转到项目 - > [MyProjectName]属性... (或键入Alt + F7),在属性窗口中切换到构建选项卡(从左侧面板)
  2. From Configuration combobox select proper build mode (in your case Release ) or select: "All Configurations" - the same options for both build modes 配置组合框中选择正确的构建模式(在您的情况下为Release )或选择:“All Configurations” - 两种构建模式的相同选项
  3. At the end in output path textbox choose folder where you want store executable file (and other created during buil of application) 在输出路径文本框的末尾,选择要存储可执行文件的文件夹(以及在构建应用程序期间创建的其他文件)

Screenshot from properties window: 属性窗口截图:

属性

This solution can be useful at least in two cases: 此解决方案至少在两种情况下非常有用:

  1. When are you learning and you want not waste space on your disc, then you can specyfy outbut file for all your project to one tmp directory and clean it in some period of time from not necessary files 你什么时候学习,而且你不想在光盘上浪费空间,那么你可以指定将所有项目的文件归档到一个tmp目录,并在一段时间内从不必要的文件中清除它
  2. When your start work with real "huge project" that include many eg .csproj projects your can create Runtime directory to storage all your executable files and files created during build of application 当您开始使用包含许多例如.csproj项目的真正“巨大项目”时,您可以创建运行时目录来存储在构建应用程序期间创建的所有可执行文件和文件

I hope that this description will be helpful. 我希望这个描述会有所帮助。

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

相关问题 Visual Studio 2012 Express调试explorer.exe-没有断点 - Visual Studio 2012 Express debugging explorer.exe - no breakpoint hit Visual Studio:在“调试”模式下生成,但文件仍在“发布”文件夹中生成 - Visual Studio: Building in Debug mode but the files still built in Release folder 扩展Visual Studio 2012 Express - Extending Visual Studio 2012 Express SpecsFor MVC / MSBuild.exe无法在Visual Studio 2012中正确构建/发布项目 - SpecsFor MVC / MSBuild.exe not building / publishing project correctly in Visual Studio 2012 无法在其他某些计​​算机上运行版本.exe中的Visual Studio 2015 C#构建 - Visual Studio 2015 C# Building in release .exe not running on some of other computers 在Visual Studio Express 2010中打开Visual Studio Express 2012项目 - Opening Visual Studio Express 2012 projects in Visual Studio Express 2010 Visual Studio 2012不构建依赖项目 - Visual Studio 2012 not building dependent projects 使用Visual Studio 2012 Express for Web将Web API和文件夹引用添加到空ASP.NET项目 - Adding Web API and folder references to empty ASP.NET project with Visual Studio 2012 Express for Web 有没有办法在Visual Studio 2012中将文件夹转换为项目? - Is there a way to convert a folder to a project in Visual Studio 2012? 从Visual Studio 2012中的文件夹打开文件 - open file from folder in visual studio 2012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM