Marcos Placona
Marcos Placona
4 min read

Categories

  • dotnet

I’ve got a pro license of Visual Studio 2012, and decided to install it instead of my existing VS 2010 Express install.

Because I didn’t actually have anything very important on my current install, I decided to uninstall my current VS 2010. When I originally installed it, I made sure it got installed on my E:\ drive. To give you a bit of context on my setup, I’ve got an SSD as a boot drive (C:\) and a specific drive (E:\) which I use to install all my programs. I find it helps me backing up my stuff, as well as “separating concerns”, since my boot drive is only used for… well booting 🙂

I then set off about installing VS2012, and the first screen I was presented with was where you actually define where your install is going to go. So I just change the drive letter to be E:\ instead of C:\.

To my surprise, this is what I saw in the next screen:

VS2012 Install screen

VS2012 Installation screen

“No good!”, it still wants to use over 2Gb of my C:\ drive, even though I told it to only use my E:\ drive.

After a bit of Googling, it it turns out more people have had this same problem, and there’s even been a blog post on MSDN about it. While there’s been some conversation on the comments in the blog post aforementioned, none one really seems to have come up with a decent (or at least temporarily decent) solution to the problem.

So here’s a “temporarily decent” solution to this problem:

Simply create a SymLink from the folder where VS “wants” to be installed, to the folder where “you” want to install it. This way, you “trick” the installer to think it’s being installed on the system drive, but is is in reality installing it to the drive you defined on your symlink.

Think of it as a shortcut to a folder deeply nested within your file system. You can have it sitting on your desktop, but when you actually open it, you will find that the path to it is something like <letter>\my\deeply\nested\directory.

So in order to do that, all you will need to do is the following:

  1. Open command line as an administrator (you can type “cmd” and right click on it to run as admin)
  2. Enter mklink /J "C:\Program Files (x86)\Microsoft Visual Studio 11.0" "E:\Program Files (x86)\Microsoft Visual Studio 11.0"
    1. Where the J flag indicates you’re creating a directory junction (see more here)
    2. The first path is where VS is trying to install itself
    3. The second path is where you want it to be installed
  3. Carry on and let it install

You will now notice the whole of it (except for things it adds to the registry) will have been installed on your preferred drive.

Q & A

Q: Why are you calling your solution “temporarily decent”? It seems perfect.

A: It turns out that when you install any updates to VS, they will end up in your system drive, since VS updates don’t “understand” symlinks, and in fact remove them.

Q: And you only say that now? What do I do then?

A: A comment added to this answer on StackOverflow seem to imply that you can do the update, and then merge your files manually by copying them into your other drive. You will need to re-create the symlink after that, but considering you don’t get udpates every day, it’s probably worth.

Q: Will this be a problem for ever?

A: By the looks of it, yes! If you read the blog post I linked above, MS seems to think that’s the way to go now, and you should have bigger drives if you wanted to have to avoid this whole workaround.