[转]Clean up after Visual Studio
本文转自:https://weblogs.asp.net/psheriff/clean-up-after-visual-studio
As programmer’s we know that if we create a temporary file during the running of our application we need to make sure it is removed when the application or process is complete. We do this, but why can’t Microsoft do it? Visual Studio leaves tons of temporary files all over your hard drive. This is why, over time, your computer loses hard disk space. This blog post will show you some of the most common places where these files are left and which ones you can safely delete.
.NET Left Overs
Visual Studio is a great development environment for creating applications quickly. However, it will leave a lot of miscellaneous files all over your hard drive. There are a few locations on your hard drive that you should be checking to see if there are left-over folders or files that you can delete. I have attempted to gather as much data as I can about the various versions of .NET and operating systems. Of course, your mileage may vary on the folders and files I list here. In fact, this problem is so prevalent that PDSA has created a Computer Cleaner specifically for the Visual Studio developer. Instructions for downloading our PDSA Developer Utilities (of which Computer Cleaner is one) are at the end of this blog entry.
Each version of Visual Studio will create “temporary” files in different folders. The problem is that the files created are not always “temporary”. Most of the time these files do not get cleaned up like they should. Let’s look at some of the folders that you should periodically review and delete files within these folders.
Temporary ASP.NET Files
As you create and run ASP.NET applications from Visual Studio temporary files are placed into the <sysdrive>:\Windows\Microsoft.NET\Framework[64]\<vernum>\Temporary ASP.NET Files folder. The folders and files under this folder can be removed with no harm to your development computer. Do not remove the "Temporary ASP.NET Files" folder itself, just the folders underneath this folder. If you use IIS for ASP.NET development, you may need to run the iisreset.exe utility from the command prompt prior to deleting any files/folder under this folder. IIS will sometimes keep files in use in this folder and iisreset will release the locks so the files/folders can be deleted.
Website Cache
This folder is similar to the ASP.NET Temporary Files folder in that it contains files from ASP.NET applications run from Visual Studio. This folder is located in each users local settings folder. The location will be a little different on each operating system. For example on Windows Vista/Windows 7, the folder is located at <sysdrive>:\Users\<UserName>\AppData\Local\Microsoft\WebsiteCache. If you are running Windows XP this folder is located at <sysdrive>:\ Documents and Settings\<UserName>\Local Settings\Application Data\Microsoft\WebsiteCache. Check these locations periodically and delete all files and folders under this directory.
Visual Studio Backup
This backup folder is used by Visual Studio to store temporary files while you develop in Visual Studio. This folder never gets cleaned out, so you should periodically delete all files and folders under this directory. On Windows XP, this folder is located at <sysdrive>:\Documents and Settings\<UserName>\My Documents\Visual Studio 200[5|8]\Backup Files. On Windows Vista/Windows 7 this folder is located at <sysdrive>:\Users\<UserName>\Documents\Visual Studio 200[5|8]\.
Assembly Cache
No, this is not the global assembly cache (GAC). It appears that this cache is only created when doing WPF or Silverlight development with Visual Studio 2008 or Visual Studio 2010. This folder is located in <sysdrive>:\ Users\<UserName>\AppData\Local\assembly\dl3 on Windows Vista/Windows 7. On Windows XP this folder is located at <sysdrive>:\ Documents and Settings\<UserName>\Local Settings\Application Data\assembly. If you have not done any WPF or Silverlight development, you may not find this particular folder on your machine.
Project Assemblies
This is yet another folder where Visual Studio stores temporary files. You will find a folder for each project you have opened and worked on. This folder is located at <sysdrive>:\Documents and Settings\<UserName>Local Settings\Application Data\Microsoft\Visual Studio\[8|9].0\ProjectAssemblies on Windows XP. On Microsoft Vista/Windows 7 you will find this folder at <sysdrive>:\Users\<UserName>\AppData\Local\Microsoft\Visual Studio\[8|9].0\ProjectAssemblies.
Remember not all of these folders will appear on your particular machine. Which ones do show up will depend on what version of Visual Studio you are using, whether or not you are doing desktop or web development, and the operating system you are using.
Summary
Taking the time to periodically clean up after Visual Studio will aid in keeping your computer running quickly and increase the space on your hard drive. Another place to make sure you are cleaning up is your TEMP folder. Check your OS settings for the location of your particular TEMP folder and be sure to delete any files in here that are not in use. I routinely clean up the files and folders described in this blog post and I find that I actually eliminate errors in Visual Studio and I increase my hard disk space.
NEW! PDSA has just published a “pre-release” of our PDSA Developer Utilities at http://www.pdsa.com/DeveloperUtilities that contains a Computer Cleaner utility which will clean up the above-mentioned folders, as well as a lot of other miscellaneous folders that get Visual Studio build-up. You can download a free trial at http://www.pdsa.com/DeveloperUtilities. If you wish to purchase our utilities through the month of November, 2011 you can use the RSVP code: DUNOV11 to get them for only $39. This is $40 off the regular price.
NOTE: You can download this article and many samples like the one shown in this blog entry at my website. http://www.pdsa.com/downloads. Select “Tips and Tricks”, then “Developer Machine Clean Up” from the drop down list.
Good Luck with your Coding, Paul Sheriff
[转]Clean up after Visual Studio的更多相关文章
- Visual Studio 中 Build、Rebuild 、 Clean 之间的区别是什么?
今天翻看c-sharpcorner技术网站看到了这样一篇小记,标题为:What Is The Difference Between Build, Rebuild And Clean In Visual ...
- 清理Visual Studio解决方案临时文件:Clean Visual Studio Solution Temporary File Build20160418
复制保存到任意文件名.bat,放置在Visual Studio Solution目录下. 当Visual Studio Solution目录过于庞大或打算拷贝移动Visual Studio Solut ...
- Visual Studio中的“build”、“rebuild”、“clean”的区别
区别 rebuild基本相当于clean+build build只针对修改过的文件进行编译,rebuild会对所有文件编译(无论是否修改). clean 删除中间和输出文件,中间文件是指一些生成应用的 ...
- Visual Studio 中 Build 和 Rebuild 的区别
因为之前写的程序比较小,编译起来比较快,所以一直都没有太在意 Build 和 Rebuild 之间的区别,后来发现两个还是有很大不同. Build 只针对在上次编译之后更改过的文件进行编译,在项目比较 ...
- 再次记录 Visual Studio 2015 CTP 5 的一个坑
接上一篇:升级 Visual Studio 2015 CTP 5 的坑.坑.坑 升级到 VS2015 CTP 之后,今天要改项目中的一个东西,然后就不得不把 C# 6.0 改变的语法代码中改了下(之前 ...
- Visual Studio命令行工具
devenv.exe Visual Studio IDE 主程序,位于VS_INSTALL_DIR/Common7/IDE. 本节内容来源:vs2010环境执行devenv /? 启动VS deven ...
- Visual Studio 启动修复命令
今天VS启动不了了,连命令行的 devenv.exe /? 都执行不了,看不到帮助命令了,记性不好,以前看过但没记住呀,还好我装了两个不同版本的VS, 另一个VS的帮助命令还是可以看到的.虽然修复了, ...
- Working with Data » Getting started with ASP.NET Core and Entity Framework Core using Visual Studio » 创建复杂数据模型
Creating a complex data model 创建复杂数据模型 8 of 9 people found this helpful The Contoso University sampl ...
- Microsoft Visual Studio Web 创作组件安装失败的解决方法
在网上查一下说是Office2007的问题.我把Office2007卸载了还是不行. 然后用Windows Install Clean Up工具清理,还是不行. 郁闷了.然后在安装包中的下面路径下找到 ...
随机推荐
- GNU Radio: 射频子板
本文简要介绍 USRP 配套的子板参数信息. 射频子板WBX-40 性能特点 频率覆盖:50 MHz – 2.2GHz 最大信号处理带宽:40MHz 行为描述 WBX-40提供高宽带收发器,可提供高达 ...
- 黄聪:C#使用能够foreach对hashtable、List遍历时“集合已修改;可能无法执行枚举操作。”错误
解决办法:使用for循环,而不是foreach循环 例如: ArrayList akeys=new ArrayList(_transmit_tb.Keys); ;p> -;p--) { _tra ...
- PAT 甲级 1010 Radix (25)(25 分)进制匹配(听说要用二分,历经坎坷,终于AC)
1010 Radix (25)(25 分) Given a pair of positive integers, for example, 6 and 110, can this equation 6 ...
- 【ZZ】C++静态库与动态库 | 菜鸟教程
C++静态库与动态库 http://www.runoob.com/w3cnote/cpp-static-library-and-dynamic-library.html
- mysql-6正则表达式
mysql正则表达式 匹配的两种方式: 1.模糊匹配:like 2.正则表达式 正则表达式语法: 语法 说明 ^ 起始位置.如果设置了RegExp对象的Multiline属性,^也匹配'\n'或'\r ...
- mysql如何处理外码约束
http://hi.baidu.com/wangzhiqing999/item/e74b2be28be445a3c00d7528 MySQL 外键约束 -- 创建测试主表. ID 是主键.CREATE ...
- Controlling DNS prefetching
Controlling DNS prefetching IN THIS ARTICLE Background Configuring prefetching in the browser Contro ...
- 2018 Multi-University Training Contest 4-Glad You Came(hdu 6356)
一.思路 线段树维护一个区间最小值,然后对于每次操作,做区间更新即可.要注意的是,在更新的时候,记得剪枝:如果当前更新的值$v \le minv$(minv为当前线段树节点所管辖区间的最小值),直接返 ...
- Ubuntu 中安装 Docker
检查 Device Mapper 是否存在 sch01ar@ubuntu:~$ ls -l /sys/class/misc/device-mapper 安装 Ubuntu 维护的版本 sch01ar@ ...
- 将Hive统计分析结果导入到MySQL数据库表中(一)——Sqoop导入方式
https://blog.csdn.net/niityzu/article/details/45190787 交通流的数据分析,需求是对于海量的城市交通数据,需要使用MapReduce清洗后导入到HB ...