Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/EmbeddedResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

static class EmbeddedResource
{
static readonly string baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
static readonly string baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "";

public static string GetContent(string relativePath)
{
Expand All @@ -31,8 +31,8 @@ public static Stream GetStream(string relativePath)
var baseName = Assembly.GetExecutingAssembly().GetName().Name;
var resourceName = relativePath
.TrimStart('.')
.Replace(Path.DirectorySeparatorChar, '.')
.Replace(Path.AltDirectorySeparatorChar, '.');
.Replace('/', '.')
.Replace('\\', '.');

var manifestResourceName = Assembly.GetExecutingAssembly()
.GetManifestResourceNames().FirstOrDefault(x => x.EndsWith(resourceName));
Expand Down