Why can't I change directory path of dotnet core sdk from C drive to S drive?

ANUPRIYA B 1 Reputation point
2022-04-27T17:11:20.59+00:00

After a long try, I installed the dotnet core on my computer. But the location PATH in the environment automatically stores the installed data of the dotnet core in the C drive. I want to change the directory path to S drive. How can I change the directory path from C to S drive?

Developer technologies | .NET | .NET Runtime
Developer technologies | .NET | Other
Developer technologies | .NET | .NET CLI
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 60,161 Reputation points
    2022-04-27T18:22:13.63+00:00

    You can't. The SDKs are installed to a shared location on the system drive. There is no reason to move them.

    Even if you did then it would likely break stuff. Refer to this doc that discusses some of the ramifications of trying to use a directory other than the default. It isn't worth the effort in most cases.


  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2022-04-29T14:41:07.38+00:00

    Because all installations of dotnet runtimes and sdk must be under the same folder, the very first install controls the folder location. To change folder, you must completely uninstall dotnet, and specify the folder on the install of first version. Also 3.1 was the first to allow specification of the folder, see install docs.

    It might be easier with a clean o/s install.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.