Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 455
Philip Tenn Avatar asked Nov 13 '22 09:11

Philip Tenn


1 Answers

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/

like image 63
Ber'Zophus Avatar answered Nov 15 '22 12:11

Ber'Zophus