问题描述
我最近注意到IISExpress&我的网站文件夹被添加到Windows 7计算机上的我的文档文件夹中.我最近安装了VS2012,所以我猜想这是罪魁祸首,但是我找不到任何可以解释如何更改这些默认设置的在线内容.
I noticed recently IISExpress & My Web Sites folders getting added to my My Documents folder on my Windows 7 machine. I recently installed VS2012, so I'm guess that's the culprit, but I haven't been able to find anything on line that explains how to change these defaults, if possible.
推荐答案
Microsoft弄乱了我的"Documents"文件夹及其所有程序的垃圾"文件夹,这也使我发疯.我在Documents
文件夹下创建了一个Data
文件夹,在其中我将所有MS应用程序(以及其他应用程序,例如Firefox的配置文件文件夹)指向所有其(通常不需要的)文件夹,并创建了一个子文件夹对于每个程序/套件.至少通过这种方式,当我备份文档"文件夹时,我可以轻松地备份所有设置.
Microsoft cluttering up my 'Documents' folder with all their programs' (junk) folders drives me insane as well. I have conceded somewhat by creating a Data
folder under my Documents
folder, where I am pointing all MS apps (and others apps such as Firefox's profile folder) to for all their (generally unwanted) folders, and with a subfolder created for each program/suite. At least this way I can easily back up all settings when I back up my 'Documents' folders.
无论如何,VS2012会安装IIS Express,这就是导致创建这些文件夹的原因.我发现了两种用于处理不需要的文件夹的解决方案.
Anyway, VS2012 installs IIS Express, which is what is causing these folders to be created. I have found two solutions for dealing with the unwanted folders.
-
卸载IIS Express.您可以从控制面板的普通Windows卸载程序"部分执行此操作.
Uninstall IIS Express. You can do this from the normal Windows 'Uninstall a Program' part of Control Panel.
更改IIS Express使用的文件夹位置,如下所示.请注意:如果您不知道自己在做什么,任何这样做的人都有可能导致计算机出现问题,因此,后果自负.请一路上也进行适当的备份!
Change the folder location that IIS Express uses, as follows. Be warned: anyone doing this risks causing problems with their computer if you don't know what you are doing, so you do so at your own risk. Please make appropriate backups along the way as well too!
a).关闭Visual Studio.
a) Close Visual Studio.
b)为IIS Express子文件夹创建一个新文件夹:
b) Create a new folder for the IIS Express sub-folders:
例如D:\My Documents\Data\Microsoft\IISExpress
c)将现有的不需要的IISExpress子文件夹(config, Logs, TraceLogFiles
)从您的My Documents > IISExpress
文件夹移动到在步骤b)中创建的文件夹.
c) Move the existing unwanted IISExpress subfolders (config, Logs, TraceLogFiles
) from your My Documents > IISExpress
folder to the folder created in step b).
d),为My Web Sites
文件夹创建一个新文件夹,我也建议在步骤b)中创建的文件夹下.
d) Create a new folder for the My Web Sites
folder, I suggest also under the folder created in step b).
例如D:\My Documents\Data\Microsoft\IISExpress\Websites
在此文件夹下,为默认的IIS Express网站创建一个网站(以防以后自动魔术"再次出现).
Under this folder, create a website for the default IIS Express website (in case it "auto-magically" reappears it's ugly head again later on).
例如D:\My Documents\Data\Microsoft\IISExpress\Websites\Default
e)转到位于以下位置的新config
文件夹:
e) Go to the newly located config
folder at:
例如D:\My Documents\Data\Microsoft\IISExpress\config
和:
i..在文本编辑器(例如记事本)中打开文件applicationhost.config
.
i. Open the file applicationhost.config
in your text editor (eg. Notepad).
ii..找到WebSite1的节点sites > site > application path > virtualDirectory path
,然后将physicalPath
值从%IIS_SITES_HOME%\WebSite1
更改为您在步骤1中创建的IIS Express 默认网站文件夹. d).
ii. Find the node sites > site > application path > virtualDirectory path
for WebSite1, and change the physicalPath
value from %IIS_SITES_HOME%\WebSite1
to the IIS Express default website folder you created in step d).
例如. %IIS_SITES_HOME%\Websites\Default
.
请注意,%IIS_SITES_HOME%
指向您的"Documents"文件夹(这似乎是IIS Express的功能",我找不到更改它的方法,并且在IIS Express时它似乎是自动配置的通过使用applicationhost.config
文件来启动).
Note that %IIS_SITES_HOME%
points to your 'Documents' folder (this appears to be a "feature" of IIS Express, I can't find a way to change it, and it appears to be auto-configured when IIS Express starts up, which it does by using the applicationhost.config
file).
对IIS Express创建的任何其他站点执行相同的操作.
Do the same for any other sites created by IIS Express.
f)创建一个新的注册表项,将IIS Express指向您创建的新文件夹(MS对此进行了部分解释:).仅供参考,注册表键以前不存在,因为IIS Express使用默认的Documents
,除非该键存在:
f) Create a new registry entry pointing IIS Express to the new folders you created (partly explained by MS here: http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-80-express-readme). FYI the registry key doesn't previously exist, as IIS Express uses a default of my Documents
unless this key exists:
i .打开Windows运行"框,例如(Windows Key) + R
i. Open the Windows 'Run' box, eg. (Windows Key) + R
ii.键入regedit
iii..导航至键:HKEY_CURRENT_USER\Software\Microsoft
iv. * 右键单击 * Microsoft
键(您刚刚导航到该键),然后选择:New > Key
iv. *Right click* the Microsoft
key (that you have just navigated to), and choose: New > Key
v.键入IISExpress
vi. * 右键单击 *刚创建的IISExpress
键,然后选择:New > String Value
vi. *Right click* the IISExpress
key that you have just created, and choose: New > String Value
vii.键入CustomUserHome
,然后按Enter
键进行保存.
vii. Type CustomUserHome
, and hit the Enter
key to save it.
viii..双击CustomUserHome
字符串为其输入值,然后在Value Data:
字段中键入在步骤b中创建的新IIS Express文件夹的路径. ),例如:D:\My Documents\Data\Microsoft\IISExpress
.按确定,您现在可以关闭注册表编辑器.
viii. Double-click the CustomUserHome
string to enter a value for it, and for the Value Data:
field, type in the path to the new IIS Express folder you created in step b), for example: D:\My Documents\Data\Microsoft\IISExpress
. Press OK, and you can now close the Registry Editor.
g)重新打开Visual Studio,它将开始使用新文件夹,并且不再在Documents
文件夹中创建文件夹.是的!!!!!
g) Reopen Visual Studio, and it should start using the new folders, as well as not create the folders in your Documents
folder anymore. Yay!!!!!
仅供参考,当我完成所有这些操作时,我实际上是以稍微不同的顺序进行操作(首先创建注册表项),但是此顺序是解释所有内容的最简单方法.只要执行所有步骤,首先创建密钥还是最后创建密钥都不重要.祝你好运!
FYI, when I did this all, I actually did it in a slightly different order (creating the registry key first), but this order was the easiest way to explain it all. Whether you create the key first or last shouldn't matter, as long as you do all the steps. Good luck!
这篇关于如何防止IISExpress&从“我的文档"文件夹中整理出来的“我的网站"文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!