Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move .dnx directory out of %USERPROFILE%

DNVM installs a .dnx directory in C:\Users\myUsername\.dnx (in %USERPROFILE%).

Unfortunately, my user profile is limited to 30 MB by IT policies.

How can I move this directory to somewhere else, e.g. C:\.dnx?

I tried creating a symbolic link from C:\Users\myUsername\.dnx to C:\.dnx, but it seems like Visual Studio does not follow symlinks when building the solution, so I get build errors such as this:

Could not find a part of the path 'C:\Users\myUsername\.dnx\packages\System.IO\4.0.10-beta-22816\lib\contract\System.IO.dll'.

I'm using Visual Studio Community 2015 RC with .NET 4.6 under Windows 7 Professional.

like image 564
leifericf Avatar asked Jun 03 '15 07:06

leifericf


2 Answers

I had an issue come up where my employer is blocking .exe files executing in user profile directories.

I moved the my C:\Users\%USERPROFILE%.dnx folder to C:\Program Files.dnx and created a symlink with the following command:

mklink /D C:\Users\%MYPROFILENAME%\.dnx "C:\Program Files\.dnx"

So far, this seems to be working and I am up and running.

like image 178
kjbetz Avatar answered Nov 17 '22 18:11

kjbetz


I found a "temporary" workaround by making the .dnx directory non-roaming, via this registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ExcludeProfileDirs

You can find more details about this workaround here.

like image 30
leifericf Avatar answered Nov 17 '22 20:11

leifericf