How to move .dnx directory out of %USERPROFILE%
Asked Answered
U

3

8

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.

Unlatch answered 3/6, 2015 at 7:22 Comment(2)
Your update looks like an answer - if so, it ought to be posted as an answer, rather than as an edit to your question.Shame
Yeah, I guess you're right - It did solve my problem, although I would really like to know how if the folder can somehow be moved instead of making in non-roaming in my user profile. It feels more like a "temporary" workaround, but I can add it as an answer instead.Unlatch
U
2

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.

Unlatch answered 4/6, 2015 at 7:3 Comment(0)
U
4

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.

Untutored answered 8/1, 2016 at 16:19 Comment(2)
This works for me as well, though I did have to run it as local admin.Lavonnelaw
That's a really good answer especially if there is no other options moving files to other drivesHappiness
U
2

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.

Unlatch answered 4/6, 2015 at 7:3 Comment(0)
T
0

Use junction tool by MS to create alias of the directory on other volume. Download junction.exe and read the usage.

Typal answered 3/6, 2015 at 8:24 Comment(3)
I already tried creating a symbolic link (junction) via command-line by doing: mklink /J .dnx C:\.dnx, but it seems like Visual Studio (or MSBuild rather) will not follow symlinks when looking up references.Unlatch
Use junction tool. I am not sure whether it creates normal symlinks or other. It works for redirection of Windows Update directory and others. Also, have you tried hard link?Typal
Yeah, /J creates a hard link to a directory. I also tried using /D which creates a soft link and is the default options if no other prefix is specified. Unfortunately, I can't install that application on this computer due to IT policy issues, so I need to use cmd to create symlinks.Unlatch

© 2022 - 2024 — McMap. All rights reserved.