DPS100
DPS100

Reputation: 83

How to change visual studio .net install path

I'm having issues with the .net framework being installed to the wrong drive. I posted a question a while ago that shows the .net framework is installing to my A: drive instead of C: drive. When I go to install the framework again, the visual studio installer has it locked to the A: drive. I have reinstalled the installer / framework and that does not fix the issue. Is there a way to change the framework location? Thanks for the help.locked to A: drive

Upvotes: 5

Views: 15612

Answers (2)

fanbyprinciple
fanbyprinciple

Reputation: 790

To clarify the above answer (I had trouble following it),

1. The default location of shared component (SDK etc.) can be changed by changing the registry value at -

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup\SharedInstallationPath

enter image description here

here change the registry value to where you want to put shared SDK components.

2. For changing IDE and download cache location -

uninstall (if any) already installed visual studio community(/enterprise etc.) installation.

And then next time when you install it will ask for components to install. In the dialog window make changes to installation location tab.

enter image description here

Upvotes: 3

Mr Qian
Mr Qian

Reputation: 23848

You have installed the VS IDE and shared components, tools and SDKs on A drive and if you want to fix this location into C drive, you have to uninstall VS and delete the shared component info from the Registry Editor. That is the only way to realize it.

Suggestions

1) first uninstall VS and then delete this value from Registry Editor

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup\SharedInstallationPath

Then, rerun vs_installer program and you can select the right disk to install it.

2) Or, you can run A:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe in your side, this program will uninstall all VS2017 and VS2019 versions and delete the info from Registry Editor at the same time. If you do not care about that, you can use it.

When you finish it, you should reinstall VS.

Update

To change VS IDE installation path, you only have to uninstall VS.

To change the shared component folder, you have to modify the key from the Registry Editor:

enter image description here

==================================================

If you only want to change the shared component folder, you should note that:

Note:

You just modify the value under registry editor. The reason we recommend that you reinstall VS and remove the key together is that simply changing the key will not store the files to a new folder. Reinstalling VS will simply put the Shared component into the new file. That is more formal.

But simply changing the value does not make much difference. In fact, do not uninstall vs so that you will spend more time downloading the files to the new changed folder next time you change or install.

=================================================

If you also want to change the VS IDE path, you have to delete that key and reinstall vs. And change to new path under the VS_installer UI.

The Microsoft' recommended shared folder path is C:\Program Files (x86)\Microsoft Visual Studio\Shared. You can use this if you change it.

Upvotes: 4

Related Questions