Skip to content
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

Remove local path discovery for AOT support #288

Merged
merged 1 commit into from
Jan 30, 2024
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
14 changes: 5 additions & 9 deletions src/EmbeddedResource.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// <auto-generated />
using System;
using System.IO;
using System.Linq;
using System.Reflection;

static class EmbeddedResource
{
#if DEBUG
static readonly string baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "";
#endif

public static string GetContent(string relativePath)
{
Expand All @@ -33,9 +27,11 @@ public static byte[] GetBytes(string relativePath)

public static Stream GetStream(string relativePath)
{
#if DEBUG
var filePath = Path.Combine(baseDir, Path.GetFileName(relativePath));
if (File.Exists(filePath))
return File.OpenRead(filePath);
#endif

var baseName = Assembly.GetExecutingAssembly().GetName().Name;
var resourceName = relativePath
Expand Down
Loading