Skip to content

Commit 315059f

Browse files
[Peek]Fix using the correct Monaco assets at runtime (#36890)
1 parent 5bb9855 commit 315059f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/common/FilePreviewCommon/MonacoHelper.cs

+4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ private static string GetRuntimeMonacoDirectory()
3838
{
3939
string baseDirectory = AppContext.BaseDirectory ?? string.Empty;
4040

41+
// AppContext.BaseDirectory returns a stray \\ so we want to remove that.
42+
baseDirectory = Path.TrimEndingDirectorySeparator(baseDirectory);
43+
4144
// If the executable is within "WinUI3Apps", correct the path first.
45+
// The idea of GetFileName here is getting the last directory in the path.
4246
if (Path.GetFileName(baseDirectory) == "WinUI3Apps")
4347
{
4448
baseDirectory = Path.Combine(baseDirectory, "..");

0 commit comments

Comments
 (0)