visual-studio 安装后更改 Visual Studio 安装文件夹

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/685575/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:18:55  来源:igfitidea点击:

Change Visual Studio installation folder after install

visual-studio

提问by Jake Hall

I'm running out of space on the partition that has Visual Studio installed. It's safe to copy the installation in another partition?

我的安装了 Visual Studio 的分区空间不足。将安装复制到另一个分区是否安全?

回答by Jake Hall

You could move the files to the new location (manually) and then use Junction (http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx) to create a link back. I did that with 2012 and it seems to be working for me.

您可以将文件移动到新位置(手动),然后使用 Junction ( http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx) 创建一个链接。我在 2012 年做到了,它似乎对我有用。

回答by Dirk Vollmar

Without having tried I bet this isn't possible.

没有尝试过,我敢打赌这是不可能的。

Installation folders are typically stored in many places such as config files and the registry. After moving, all these references will still point to the old and now invalid location. And, even worse, moving the folder will also break any installation / uninstallation / update routines which means that you will no longer be able to install patches and service packs.

安装文件夹通常存储在许多地方,例如配置文件和注册表。移动后,所有这些引用仍将指向旧的且现在无效的位置。而且,更糟糕的是,移动文件夹还会破坏任何安装/卸载/更新例程,这意味着您将无法再安装补丁和服务包。

Conclusion: You are way better off uninstalling Visual Studio and moving it to the new location. It takes only a short time as compared to the headache that you would end up otherwise.

结论:最好卸载 Visual Studio 并将其移动到新位置。与否则会引起的头痛相比,它只需要很短的时间。

(Or, if you don't like to do that you can of course still mount a new partition to the program files folder to increase disc space or get a larger hard drive)

(或者,如果您不喜欢这样做,您当然仍然可以将新分区挂载到程序文件文件夹以增加磁盘空间或获得更大的硬盘驱动器)

回答by Aidan Fitzpatrick

No, that wouldn't work with any newer versions of Visual Studio. If it's pre-2003 you might have a chance.

不,这不适用于任何较新版本的 Visual Studio。如果是 2003 年之前,您可能有机会。

回答by Andrei

I tried repairing or modifying it via the installer (add remove programs), because I moved it to another Partition. But nothing, it crashes with weird error reports.
Uninstalling and reinstalling seems the only choice, but that doesn't work either...

我尝试通过安装程序修复或修改它(添加删除程序),因为我将它移到了另一个分区。但没什么,它会因奇怪的错误报告而崩溃。
卸载和重新安装似乎是唯一的选择,但这也不起作用......

I used a USB Stick, gave it the old HDD label and made a junction like described here:
https://superuser.com/questions/484061/how-to-create-an-ntfs-junction

我使用了 USB 记忆棒,给它贴上了旧的 HDD 标签,并进行了如下所述的连接:https:
//superuser.com/questions/484061/how-to-create-an-ntfs-junction

mklink /J <new directory to be linked> <target directory>

D:\>mklink /J "Program Files\Microsoft Visual Studio 11.0" "K:\Program Files\Mic
rosoft Visual Studio 11.0"

This doesn't work unfortunately because VS still complains about other missing files, but it at least let's you unistall it.

不幸的是,这不起作用,因为 VS 仍然抱怨其他丢失的文件,但至少可以让您卸载它。

EDIT: If you try to reinstall VS and it won't let you choose a different folder look here at the accepted answer: How to change Visual Studio 2012 install directory?

编辑:如果您尝试重新安装 VS 并且它不会让您选择其他文件夹,请在此处查看已接受的答案:如何更改 Visual Studio 2012 安装目录?