Is there a "debug" and "release" build in VS 2005? If so, how do I switch between the two?
在VS 2005中是否有“调试”和“发布”版本?如果是这样,我该如何在两者之间切换?
4 个解决方案
#1
Saif:
Are you working on an ASP.NET web site project?
您是否正在开发ASP.NET网站项目?
If so, Visual Studio delegates the build step to the ASP.NET runtime, and the ASP.NET runtime picks up debug versus release in the web.config .
如果是这样,Visual Studio会将构建步骤委托给ASP.NET运行时,ASP.NET运行时会在web.config中选择调试与发布。
I have a post on the topic that will help: Debug and Release Builds in ASP.NET 2.0
我有一篇关于这个主题的帖子将有所帮助:ASP.NET 2.0中的调试和发布版本
Note that a couple things have changed since that time. Namely, MSFT released two add-ins for VS 2005 - one to add real web application projects that have debug and release settings (for the code-behind and loose c# files), and they also released web deployment projects, which can use the asp.net command line compiler. Web App projects became a part of VS2005 in SP1, too.
请注意,从那时起,有些事情发生了变化。也就是说,MSFT为VS 2005发布了两个加载项 - 一个用于添加具有调试和发布设置的实际Web应用程序项目(用于代码隐藏和松散的c#文件),并且他们还发布了可以使用asp的Web部署项目.net命令行编译器。 Web App项目也成为了VS2005 SP1的一部分。
#2
Use the Configuration Manager. Right-click on your solution in the Solution Explorer, select "Configuration Manager...", and change the active solution configuration.
使用配置管理器。在解决方案资源管理器中右键单击您的解决方案,选择“Configuration Manager ...”,然后更改活动的解决方案配置。
You can change your project's behavior when in debug or release mode. Bring up your project properties pane, select the appropriate configuration from the dropdowns at top, and change the settings as appropriate. Notice that some changes are made by default for you. For instance, release builds by default are set to optimize code, and debug builds are not.
您可以在调试或释放模式下更改项目的行为。打开项目属性窗格,从顶部的下拉列表中选择适当的配置,并根据需要更改设置。请注意,默认情况下会对您进行一些更改。例如,默认情况下,发布版本设置为优化代码,而调试版本则不是。
#3
In the ASP.NET web.config file there is a debug="true" attribute. The first time you run the web application Visual Studio will ask you if you want to turn on debugging, selecting yes will cause Visual Studio to edit the config file for you.
在ASP.NET web.config文件中有一个debug =“true”属性。第一次运行Web应用程序时Visual Studio将询问您是否要打开调试,选择yes将导致Visual Studio为您编辑配置文件。
Just remember to make sure you change that back to false for your release builds. For more info click here.
请记住确保为发布版本将其更改为false。欲了解更多信息请点击这里。
#4
The quick way is to right click on the toolbars and turn on the standard toobar. Then you can quickly change between build targets by choosing the one you want from the solutions configuration drop down.
快速方法是右键单击工具栏并打开标准工具栏。然后,您可以通过从解决方案配置下拉列表中选择所需的目标来快速更改构建目标。
If you want to change what those configurations do, then follow what Michael Petrotta said in his answer.
如果你想改变这些配置的作用,那么请按照Michael Petrotta在他的回答中所说的那样。
#1
Saif:
Are you working on an ASP.NET web site project?
您是否正在开发ASP.NET网站项目?
If so, Visual Studio delegates the build step to the ASP.NET runtime, and the ASP.NET runtime picks up debug versus release in the web.config .
如果是这样,Visual Studio会将构建步骤委托给ASP.NET运行时,ASP.NET运行时会在web.config中选择调试与发布。
I have a post on the topic that will help: Debug and Release Builds in ASP.NET 2.0
我有一篇关于这个主题的帖子将有所帮助:ASP.NET 2.0中的调试和发布版本
Note that a couple things have changed since that time. Namely, MSFT released two add-ins for VS 2005 - one to add real web application projects that have debug and release settings (for the code-behind and loose c# files), and they also released web deployment projects, which can use the asp.net command line compiler. Web App projects became a part of VS2005 in SP1, too.
请注意,从那时起,有些事情发生了变化。也就是说,MSFT为VS 2005发布了两个加载项 - 一个用于添加具有调试和发布设置的实际Web应用程序项目(用于代码隐藏和松散的c#文件),并且他们还发布了可以使用asp的Web部署项目.net命令行编译器。 Web App项目也成为了VS2005 SP1的一部分。
#2
Use the Configuration Manager. Right-click on your solution in the Solution Explorer, select "Configuration Manager...", and change the active solution configuration.
使用配置管理器。在解决方案资源管理器中右键单击您的解决方案,选择“Configuration Manager ...”,然后更改活动的解决方案配置。
You can change your project's behavior when in debug or release mode. Bring up your project properties pane, select the appropriate configuration from the dropdowns at top, and change the settings as appropriate. Notice that some changes are made by default for you. For instance, release builds by default are set to optimize code, and debug builds are not.
您可以在调试或释放模式下更改项目的行为。打开项目属性窗格,从顶部的下拉列表中选择适当的配置,并根据需要更改设置。请注意,默认情况下会对您进行一些更改。例如,默认情况下,发布版本设置为优化代码,而调试版本则不是。
#3
In the ASP.NET web.config file there is a debug="true" attribute. The first time you run the web application Visual Studio will ask you if you want to turn on debugging, selecting yes will cause Visual Studio to edit the config file for you.
在ASP.NET web.config文件中有一个debug =“true”属性。第一次运行Web应用程序时Visual Studio将询问您是否要打开调试,选择yes将导致Visual Studio为您编辑配置文件。
Just remember to make sure you change that back to false for your release builds. For more info click here.
请记住确保为发布版本将其更改为false。欲了解更多信息请点击这里。
#4
The quick way is to right click on the toolbars and turn on the standard toobar. Then you can quickly change between build targets by choosing the one you want from the solutions configuration drop down.
快速方法是右键单击工具栏并打开标准工具栏。然后,您可以通过从解决方案配置下拉列表中选择所需的目标来快速更改构建目标。
If you want to change what those configurations do, then follow what Michael Petrotta said in his answer.
如果你想改变这些配置的作用,那么请按照Michael Petrotta在他的回答中所说的那样。