更改Visual Studio模拟器存储.vhd文件的默认路径是否可行?默认情况下,它设置为在我的%LOCALAPPDATA%文件夹下存储,但这在C驱动器上,我正在C驱动器上耗尽空间。
我怎样才能将其设置为存储在D:\ emulators中?
更改Visual Studio模拟器存储.vhd文件的默认路径是否可行?默认情况下,它设置为在我的%LOCALAPPDATA%文件夹下存储,但这在C驱动器上,我正在C驱动器上耗尽空间。
我怎样才能将其设置为存储在D:\ emulators中?
@Ionian316
1/ 打开注册表编辑器。
2/ 转到:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudioEmulator\Android\Configuration\
3/ 查找文件UserConfigurationPath
4/ 在此处输入您的路径:
默认路径是:%LOCALAPPDATA%\Microsoft\VisualStudioEmulator\Android
新路径示例:D:\VisualStudioEmulator\Android
当然,您应该将默认路径复制到新路径中,以避免出现错误。
编辑 1
在 VS Emulator for Android 故障排除中指出了一个解决方案(link):
然而,这个解决方案似乎已经过时,不适用于当前可用的 VS Emu 4 Android 版本。我找不到树中的注册表文件夹。
编辑 2
这里有一个简单的方法,我用它来更改 vhd 的根路径。
情况 1:已安装
%USERPROFILE%\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\
重命名为其他名称,以备份。D:\emulators
。MKLINK /J %USERPROFILE%\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\ D:\emulators
,按Enter键。D:\emulators
中。情况2:尚未安装
D:\emulators
中。编辑3
注意:
为了在 Hyper-V 中正确使用 vhd(VSEmu4Android 使用的虚拟硬盘格式),您的 D:\emulators
文件夹及其内部的文件不应该被压缩。