Skip to content

Commit

Permalink
[Peek]Fix using the correct Monaco assets at runtime (#36890)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo authored Jan 15, 2025
1 parent 5bb9855 commit 315059f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common/FilePreviewCommon/MonacoHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ private static string GetRuntimeMonacoDirectory()
{
string baseDirectory = AppContext.BaseDirectory ?? string.Empty;

// AppContext.BaseDirectory returns a stray \\ so we want to remove that.
baseDirectory = Path.TrimEndingDirectorySeparator(baseDirectory);

// If the executable is within "WinUI3Apps", correct the path first.
// The idea of GetFileName here is getting the last directory in the path.
if (Path.GetFileName(baseDirectory) == "WinUI3Apps")
{
baseDirectory = Path.Combine(baseDirectory, "..");
Expand Down

0 comments on commit 315059f

Please sign in to comment.