diff --git a/src/EmbeddedResource.cs b/src/EmbeddedResource.cs index 018b5475..bc664a20 100644 --- a/src/EmbeddedResource.cs +++ b/src/EmbeddedResource.cs @@ -1,12 +1,4 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - +// using System; using System.IO; using System.Linq; @@ -14,7 +6,9 @@ static class EmbeddedResource { +#if DEBUG static readonly string baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? ""; +#endif public static string GetContent(string relativePath) { @@ -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