简体   繁体   中英

How can I change IIS Express 8.0 install directory so it doesn't use “My Documents”?

Is it possible to change IIS Express 8.0 so that its install and configuration directory is not under "My Documents"?

In our environment, "My Documents" is mapped to a network share.

The problem is that this makes local development in Visual Studio .NET 2012 dependent on being on the network.

When I run my ASP.NET MVC 4 application in Visual Studio .NET 2012 , it spins up IIS Express 8.0 .

To be quite honest, I'm not sure how IIS Express 8.0 originally got on my development machine. I did not install it directly. However, I have installed both Visual Studio .NET 2012 and Microsoft WebMatrix 2.0 and suspect it came with one (or both) of these.

I tried uninstalling IIS Express 8.0 from Programs and Features , going to Microsoft Download Center - IIS 8.0 Express , downloading iisexpress_8_0_RTM_x64_en-US.msi , and reinstalling it.

However, during the install process, I did not see any options for selecting an installation directory.

If anyone has any experience on changing this, I would be very appreciative of advice or insight. Thank you very much.

Sadly, I think the answer is: this can't be done...yet.

I wanted this myself, so I dug deep into Process Monitor to see if there was some key or file config that could control it. It looks like that key is: HKCU\\Software\\Microsoft\\IISExpress\\CustomUserHome (REG_SZ). You can set this to your own custom path on your local drive, and IISExpress will honour it perfectly.

Alas, Visual Studio doesn't use it properly. I think this is a bug. ProcMon shows Visual Studio (briefly) making use of the CustomUserHome entry, but then still going and looking for necessary config files in the %UserProfile%\\IISExpress\\config\\ folder.

Thus, if you were to try this fix (with the as-of-now current Visual Studio 2012 Update 2 at least), it might sorta look like it's working, but in reality it's still using the same %UserProfile%\\IISExpress\\config\\ folder. If you delete or move that folder, your project won't even open at all.

If there's a way to tell Visual Studio what IISExpress user directory to use, I haven't found it, but would be happy to be enlightened.

This blog post shows a somwhat-similar situation affected by the same bug: http://areaofinterest.wordpress.com/2012/11/13/vs2012-iisexpress-migration-of-domainuser-and-network-share-wtf/

The problem is that this makes local development in Visual Studio .NET 2012 dependent on being on the network.

You might want to try a different approach to solving this problem.

Make the Documents\\IIS Express folder on the network share "Always available offline" . This uses the Offline Storage feature of Windows to locally cache the network folder and bi-directionally sync changes whenever the network share is available.

In fact, it's probably better to make the entire Documents folder "Always available offline" to avoid potential problems with other applications that store their user data there and expect that data to always be available.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM