-
Notifications
You must be signed in to change notification settings - Fork 460
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
[QUESTION] Is there any plan following GetFolderPath
changes in .NET 8?
#522
Comments
Thank you for flagging that. I added this to our notes on the .NET 8 upgrade. I will keep this thread updated with details as I have them |
Confirming that the plan is to maintain |
VCC and VCC CLI are moving to .NET 6 with VCC 2.4.0 (next major release) which will maintain the existing path. |
The CLI pre-release using .NET 8 and pathing fix is available now https://www.nuget.org/packages/VRChat.VPM.CLI#versions-body-tab
If everything goes well - this should go live in the near future |
It looks vpm cli 0.1.28-beta.1 is using In general, *nix platform can use any character in file system entry name, so when you request OS to access directory named Also I found that VPM Cli is using #nullable enable
using System;
using System.IO;
using System.Runtime.InteropServices;
string GetVCCDirectory()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// For windows platform, we use the %LOCALAPPDATA%\VRChatCreatorCompanion directory
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "VRChatCreatorCompanion");
}
else
{
// For *nix platform, we use the $XDG_DATA_HOME/VRChatCreatorCompanion directory
var xdgDataHome = Environment.GetEnvironmentVariable("XDG_DATA_HOME");
if (string.IsNullOrEmpty(xdgDataHome))
{
// if XDG_DATA_HOME is not set, we use the default value
// Default value of XDG_DATA_HOME is $HOME/.local/share
// We should use default value even if XDG_DATA_HOME is defined with empty value.
// Please read https://specifications.freedesktop.org/basedir-spec/latest/#variables
// for more information.
var home = Environment.GetEnvironmentVariable("HOME");
if (string.IsNullOrEmpty(home)) throw new InvalidOperationException("HOME is not set");
xdgDataHome = Path.Combine(home, ".local", "share");
}
return Path.Combine(xdgDataHome, "VRChatCreatorCompanion");
}
} |
This should be fixed in the 0.1.28-beta.2 |
it looks working well in 0.1.28-beta.2. |
In current VPM CLI and vpm-resplver, it looks
System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
is used for base path ofsettings.json
and other VCC and VPM related files.However, .NET 6 is being dead and .NET 8 is here, and I think VPM CLI will need to move to .NET 8 soon.
However, in .NET 8,
System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
will return other directory on macOS.This will cause compatibility problem in my tool and future VPM so I opened this issue.
As a command-line tools, it's common to use
$XDG_DATA_HOME
or$HOME/.local/share
on macOS and Unity mono still returns them forEnvironment.GetFolderPath
, and, I think it's better to use$XDG_DATA_HOME
on macOS.For more information about breaking changes in .NET 8, please refer https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/8.0/getfolderpath-unix and dotnet/runtime#68610
The text was updated successfully, but these errors were encountered: