C#: Fix AppContext.BaseDirectory

This commit is contained in:
RedworkDE 2023-02-04 14:33:02 +01:00
parent 0b1d516f67
commit fb0adaff9f

View file

@ -30,7 +30,7 @@ namespace GodotPlugins
if (baseDirectory != null)
{
if (!Path.EndsInDirectorySeparator(baseDirectory))
baseDirectory += Path.PathSeparator;
baseDirectory += Path.DirectorySeparatorChar;
// This SetData call effectively sets AppContext.BaseDirectory
// See https://github.com/dotnet/runtime/blob/v6.0.0/src/libraries/System.Private.CoreLib/src/System/AppContext.cs#L21-L25
AppDomain.CurrentDomain.SetData("APP_CONTEXT_BASE_DIRECTORY", baseDirectory);