---
title: "Visual Studio 2008 每日提示(十六)"
author: "cjc"
date: "2008-12-26T02:28:00Z"
tags: []
slug: "visual-studio-2008"
draft: false
lastmod: "2008-12-26T02:28:00Z"
id: 402671
url: "https://cjc.iteye.com/blog/402671"
---

&lt;script&gt;function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}&lt;/script&gt;

本篇包括tip151-tip160  
[http://www.watch-life.net/visual-studio/visual-studio-2008-tip-day-16.html](http://www.watch-life.net/visual-studio/visual-studio-2008-tip-day-16.html)

## #151、意外关机情况下，保存自动恢复文件

原文链接:[Where Visual Studio saves auto-recovered files in the case of an unexpected shutdown](http://blogs.msdn.com/saraford/archive/2008/02/14/did-you-know-where-visual-studio-saves-auto-recovered-files-in-the-case-of-an-unexpected-shutdown-151.aspx)

**操作步骤：**  
菜单：**工具+环境+自动恢复**，选中“保存自动恢复信息的时间间隔”，同时设定“保留自动恢复信息的天数”。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.WhereVisualStudiosavesautorecoveredf_A03B/image_thumb.png)

自动恢复文件保存的位置在： ...\\My Documents\\Visual Studio 2008\\Backup Files\\&lt;projectname&gt;&lt;/projectname&gt;

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.WhereVisualStudiosavesautorecoveredf_A03B/image_thumb_1.png)

在意外关机后重新启动开发环境时，会出现“集成开发环境恢复文件”对话框。你可以选择备份文件或忽略它

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.WhereVisualStudiosavesautorecoveredf_A03B/image_thumb_2.png)

**评论：有这个功能，就不怕没及时保存写好的代码搞丢失了。当然，随时保存还是最保险的习惯。**

## #152、解决方案管理器支持自动查找匹配（type-ahead）

原文链接:[the Solution Explorer supports type-ahead selection](http://blogs.msdn.com/saraford/archive/2008/02/15/did-you-know-the-solution-explorer-supports-type-ahead-selection-152.aspx)

在解决方案管理器的树视图，展开一个节点，如果文件名，会自动匹配全部或部分文件名，选中该文件。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.theSolutionExplorersupportstypeahead_A604/image_thumb.png)

**评论：这个功能windows 资源管理器就具备，如果在解决方案管理器也可以，是不是很酷。**

## #153、在一个解决方案里再加一个解决方案

原文链接:[You can add a solution to a solution](http://blogs.msdn.com/saraford/archive/2008/02/18/did-you-know-you-can-add-a-solution-to-a-solution-153.aspx)

**操作步骤：**  
1、打开一个解决方案。  
2、菜单：**文件+现有项目**，在“**添加现有项目**”对话框单击“**对象类型**”，选择“**解决方案文件**”，然后选择你想添加的解决方案。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Didyouk.Youcanaddasolutiontoasolution153_A7E4/AddSolutionsToSolutions_thumb.jpg)

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Didyouk.Youcanaddasolutiontoasolution153_A7E4/AddSolutionsToSolutions2_thumb.jpg)

**评论：没想到，在解决方案里还可以添加解决方案，嗯，这样就可以多个解决方案一起来做了。**

## #154、改变解决方案默认保存位置

原文链接:[how to change the default new project location](http://blogs.msdn.com/saraford/archive/2008/02/19/did-you-know-how-to-change-the-default-new-project-location.aspx)

**操作步骤：**  
菜单：**工具+选项+项目和解决方案+常规**，在“Visual Studio 项目位置”文本框填入你想保存的目录。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.howtochangethedefaultnewprojectlocat_C55D/DefaultProjectLocation2_thumb.jpg)

**评论：这个功能不知道的人恐怕不多**

## #155、在新建项目窗口切换大小图标

原文链接:[You can toggle between small icons and large icons in the New Project Dialog](http://blogs.msdn.com/saraford/archive/2008/02/20/did-you-know-you-can-toggle-between-small-icons-and-large-icons-in-the-new-project-dialog-155.aspx)

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.Youcantogglebetweensmalliconsandlarg_CB12/NewProjectSmallIcons_thumb.jpg)

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.Youcantogglebetweensmalliconsandlarg_CB12/NewProjectLargeIcons_thumb.jpg)

图片就可以说明一切了。

**评论：你也许从来留意过这个功能吧**

## #156、在解决方案管理器中隐藏或显示解决方案

原文链接:[How to hide or show the solution in solution explorer](http://blogs.msdn.com/saraford/archive/2008/02/21/did-you-know-how-to-hide-or-show-the-solution-in-solution-explorer-156.aspx)

**操作步骤：**  
菜单：**工具+选项+项目和解决方案+常规**，有个选项“总是显示解决方案”，选中就会显示解决方案，反之则不显示。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.Howtohideorshowthesolutioninsolution_CFF8/AlwaysShowSolution_thumb.jpg)

不显示的效果如下

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.Howtohideorshowthesolutioninsolution_CFF8/NoSolutionNode_thumb.jpg)

**评论：我一般都显示，不显示还有些不习惯。**

## #157、在解决方案文件夹下隐藏项目

原文链接:[You can use Solution Folders to hide projects](http://blogs.msdn.com/saraford/archive/2008/02/22/did-you-know-you-can-use-solution-folders-to-hide-projects-157.aspx)

**操作步骤：**  
在解决方案里添加一个“**解决方案文件夹**”，把项目放到该文件夹里，右键刚才所建的解决方案文件夹，从邮件菜单中选择“**隐藏**”。在隐藏的状态，你仍然可以编译生成。

隐藏前

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucanuseSolutionFolderstohideprojec_E3F5/SolutionFolders1_thumb_1.jpg)

隐藏后  
![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucanuseSolutionFolderstohideprojec_E3F5/SolutionFolders2_thumb.jpg)

**评论：以前很少用解决方案文件夹，以后要花时间研究一下了.**

## #158、创建临时的项目

原文链接:[You can create temp or "throw away" projects](http://blogs.msdn.com/saraford/archive/2008/02/25/did-you-know-you-can-create-temp-or-throw-away-projects-158.aspx)

**操作步骤：**  
菜单：**工具+选项+项目和解决方案+常规**，**不**选中“**创建时保存新项目**”

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.Youcancreatetemporthrowawayprojects1_EAD9/ZeroImpactProjects_thumb.jpg)

则在新建项目的时候，不再提供项目保存位置。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.Youcancreatetemporthrowawayprojects1_EAD9/ZeroImpactProjects2_thumb.jpg)

**评论：如果你只是临时写个项目，比如测试项目，但并不想保存，这个功能比较有用。当然，如果你还想保存的话，在保存前，再把这个选项选中即可，在保存的时候会有保存的对话框，供选择保存目录。**

## #159、在生成有错误的时候，显示或不显示生成错误列表

原文链接:[How to show or prevent the Error List from appearing after a failed build](http://blogs.msdn.com/saraford/archive/2008/02/26/did-you-know-how-to-show-or-prevent-the-error-list-from-appearing-after-a-failed-build-159.aspx)

**操作步骤：**  
菜单：**工具+选项+项目和解决方案+常规**，有个选项“**若项目生成时有错误，则始终显示错误列表**”，选中就显示，反之则不显示

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.HowtoshoworpreventtheErrorListfromap_F798/AlwaysShowErrorList_thumb.jpg)

**评论：如果你不显示了，恐怕对查错不方便.**

## #160、Visual Studio 2008支持多框架定向

原文链接:[Visual Studio 2008 Supports multi-targeting of the .NET Framework](http://blogs.msdn.com/saraford/archive/2008/02/27/did-you-know-visual-studio-2008-supports-multi-targeting-of-the-net-framework-160.aspx)

Visual Studio 2008允许你构建针对多个.NET框架版本的应用，目前支持net2.0、3.0、3.5。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Didyouknow...VisualStudi.NETFramework160_E874/MultiTargeting_thumb_1.jpg)

**评论：这个功能是vs2008最大的亮点。让使用vs2005的用户可以非常平滑的过度到vs2008**

更多文章见：守望轩\[[http://www.watch-life.net](http://www.watch-life.net/)/]