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?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,342 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
322 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,117 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 47,711 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.

    0 comments No comments

  2. Bruce (SqlWork.com) 54,866 Reputation points
    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