New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request, able to config the location of ~/.dotnet and ~/.templateengine #8678
Comments
The location is fixed relative to user profile This may not be 100% what you want, you can change the environment variable USERPROFILE on windows, HOME on Linux. Which will create a .dotnet under that folder. Note, changing that variable will also affect other program rely on it |
Please feel free to reopen if you need more detail |
Hi @wli3 , Thanks for your response. However, my understanding is this is an opportunity for improvement. We have a similar issue related to ~/.templateengine folder and people from template engine team are working on make it configurable. Please, see the link below and let me know your considerations. |
As a linux power user, I would love it if both |
Migrating this over from #1543. Of note, I believe it is important to change the default storage paths, not just make them configurable (though both are valuable in their own right). At the moment, dotnet/cli does not respect OS conventions. I just installed .NET Core SDK onto a Windows 10 Pro (Fall Creators Update) machine. As a side effect, it appears to have created a folder in Not only does the As a side note, is there a way I can override this setting while waiting for this issue to be resolved? The files in this folder appear to not be intended for human consumption, and I really try to keep my |
In Windows, configuration files should not be stored in %USERPORFILE%. They should be in %APPDATA%. Please respect Windows standards. Moreover, you should consider XDG user directories in Linux. |
@livarcocc Is this still in our backlog? |
Yes. |
Has there been any progress towards this issue, or an expectation of what milestone this will be addressed in? |
Has there been any progress towards this, or would you be open to someone submitting a PR? |
Also will setting |
Just tried setting $ dotnet --help
.NET Core SDK (3.1.103)
$ export DOTNET_CLI_HOME=~/tmp
$ rm -r ~/.dotnet
$ dotnet build ...
$ ls ~/.dotnet
corefx optimizationdata
$ ls -a ~/tmp
. .. .dotnet .nuget Edit: Splitting the user config from any cached data would be useful e.g. as specified here |
I see. This is not ideal. Different component of .NET core stack have different code paths to decide the persistent storage. It is not an easy fix. I don't think this is something community can easily contribute since it requires coordination between runtime, templates engine, CLI and nuget. It would also require a large amount of testing to ensure there is no regression. So far there is no roadmap for this issue. |
export NUGET_PACKAGES="$XDG_CACHE_HOME"/NuGetPackages |
Any progress on this one? |
There's also And of course tests for that, too. Now for Various scripts, of course a ton of tests, and there's a ...and that's before we touch on any user tools, on interaction between SDK versions and their tooling. So yeah, this thing is very hardcoded basically, across different tools and non-C# files (definitions, scripts). |
So annoying! |
The more the devs postpone it, the larger their technical debt will be (as this will have to be implemented, sooner or later). |
@dotnet/templating-engine-maintainers we did some work recently on the directory of the template engine cache, didn't we? Is this still an issue for the template engine? |
Dotnet new now respects DOTNET_CLI_HOME environment variable to define the location of settings. It is also possible to override location of settings with --debug:custom-hive option with path for the settings. Tagged item to provide more details on triage. |
The fix for DOTNET_CLI_HOME was introduced in the scope of: Or you can use |
I don't think changing that is supported at all. I won't even dare try changing that or I'll probably completely screw up my Windows installation. |
I'd like to change my DOTNET_CLI_HOME but I don't know what the default of that folder is, so I can know which folder I should move into that new location when I change it. And I can't seem to be able to find anything about that environment variable when googling, apart from GitHub issues. It doesn't seem to be documented anywhere. It's not even mentioned here: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables Is DOTNET_CLI_HOME equivalent to the default %userprofile%.dotnet? Meaning when I change the environment variable to a custom directory, I should move my current content of .dotnet there? Or does DOTNET_CLI_HOME represent a subdirectory within that? Or a parent directory, so that .dotnet will be created as a subfolder? |
I agree. It's not great that cache files (that can be repopulated at any time) and config files are both in the same directory tree. Cache files should be stored either in %LOCALAPPDATA% (user\AppData\Local) or in %TEMP% by default, whereas config files should be stored in %APPDATA% (user\AppData\Roaming) by default. |
This is still not fixed as the default location afaict. |
Forgive a slight off-topic, but what did you set |
Hi @livarcocc ,
May you can help me with this simple question. Is there anyway to re-locate the dotnet user profile folder (.dotnet)?
The text was updated successfully, but these errors were encountered: