diff --git a/CompatBot/CompatBot.csproj b/CompatBot/CompatBot.csproj
index fda4c318..e9b52ed5 100644
--- a/CompatBot/CompatBot.csproj
+++ b/CompatBot/CompatBot.csproj
@@ -35,8 +35,8 @@
-
-
+
+
diff --git a/SourceGenerators/Win32ErrorsSourceGenerator.cs b/SourceGenerators/Win32ErrorsSourceGenerator.cs
index 38c2fc41..87e4f9eb 100644
--- a/SourceGenerators/Win32ErrorsSourceGenerator.cs
+++ b/SourceGenerators/Win32ErrorsSourceGenerator.cs
@@ -29,13 +29,15 @@ public class Win32ErrorsSourceGenerator : ISourceGenerator
public void Execute(GeneratorExecutionContext context)
{
- var resourceName = context.AdditionalFiles.FirstOrDefault(f => Path.GetFileName(f.Path).Equals("win32_error_codes.txt"));
+ var resourceName = context.AdditionalFiles
+ .OrderBy(f => f.Path, StringComparer.OrdinalIgnoreCase)
+ .LastOrDefault(f => Path.GetFileName(f.Path) is string fname && fname.StartsWith("win32_error_codes") && fname.EndsWith(".txt"));
if (resourceName is null)
- return;
+ throw new InvalidOperationException("Failed to locate win32_error_codes txt file");
using var stream = File.Open(resourceName.Path, FileMode.Open, FileAccess.Read, FileShare.Read);
if (stream is null)
- throw new InvalidOperationException("Failed to get win32_error_codes.txt stream");
+ throw new InvalidOperationException("Failed to get win32_error_codes txt stream");
if (!context.AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.RootNamespace", out var ns))
ns = context.Compilation.AssemblyName;
diff --git a/win32_error_codes.txt b/win32_error_codes_v19.0.txt
similarity index 100%
rename from win32_error_codes.txt
rename to win32_error_codes_v19.0.txt