如何在不带.suo文件的Visual Studio中设置默认配置 [英] How to set a default configuration in a Visual Studio without .suo file

查看:183
本文介绍了如何在不带.suo文件的Visual Studio中设置默认配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS2013 Pro中,打开解决方案后的默认配置为调试".

In VS2013 Pro, the default configuration after open solution is "Debug".

如何将我的默认配置更改为发布"没有.suo文件?

How to change my default configuration to "Release" without .suo file ?

我试图订购"Release"(发布)在调试"之前的模式. .sln文件中的模式,但仍然无法正常工作

I tried to order "Release" mode before "Debug" mode in my .sln file, but it's still not working

GlobalSection(SolutionConfigurationPlatforms)= preSolution

GlobalSection(SolutionConfigurationPlatforms) = preSolution

  释放|任何CPU =释放|任何CPU

   Release|Any CPU = Release|Any CPU

  发布|混合平台=发布|混合平台

   Release|Mixed Platforms = Release|Mixed Platforms

   Release | x86 = Release | x86

   Release|x86 = Release|x86

  调试|任何CPU =调试|任何CPU

   Debug|Any CPU = Debug|Any CPU

  调试|混合平台=调试|混合平台

   Debug|Mixed Platforms = Debug|Mixed Platforms

  调试| x86 =调试| x86

   Debug|x86 = Debug|x86

EndGlobalSection

EndGlobalSection

推荐答案

嗨Copperhead89,

Hi Copperhead89,

解决方案的解决方案配置存储在.suo文件中,该文件包含每个用户 解决方案选项.我已经检查了Visual Studio和.sln的所有配置,没有这样的设置可以设置默认的解决方案配置.

The Solution Configuration for solution is stored in .suo file which contains per-user solution options. I have checked all configurations for Visual Studio and .sln, there doesn't have such settings could set default Solution Configuration.

如果您希望解决方案下的所有项目都以发布模式构建,则有两种方法可以实现您的需求.

If you want all projects under the solution build in release mode, there are two ways to implement your requirement.

第一种方法是,使用MSBuild构建您的解决方案,并使用"/p:Configuration = Release"命令,该命令将以发布模式构建您的解决方案.

First way, build your solution with MSBuild and use the command of "/p:Configuration=Release", which will build your solution in release mode.

请参考:

http://stackoverflow.com/questions /25494344/building-c-sharp-solution-in-release-mode-using-msbuild-exe

第二种方式,请通过构建"菜单->将每个项目的构建都设置为发布模式.配置管理器.然后,您可以在配置管理器"窗口中设置每个项目,此配置将存储在项目文件中.

Second way, please set every project build in release mode through Build menu -> Configuration Manager. Then you can set every project on the Configuration Manager window and this configuration will be stored in project file.

最好的问候,
Weiwei

Best Regards,
Weiwei


这篇关于如何在不带.suo文件的Visual Studio中设置默认配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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