Skip to content

Commit

Permalink
Use Assembly.GetExecutingAssembly() instead Assembly.GetEntryAssembly()
Browse files Browse the repository at this point in the history
  • Loading branch information
arenekosreal committed Dec 3, 2024
1 parent b465eb5 commit 7860a64
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions E5Renewer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@
}
);

if (Assembly.GetEntryAssembly() is Assembly entryAssembly)
{
IEnumerable<Assembly> assembliesInAttribute = entryAssembly.GetCustomAttributes<AssemblyContainsModuleAttribute>()
.Select((attribute) => attribute.assembly);
builder.Services.AddModules(assembliesInAttribute.ToArray());
}
IEnumerable<Assembly> assembliesInAttribute = Assembly.GetExecutingAssembly()
.GetCustomAttributes<AssemblyContainsModuleAttribute>()
.Select((attribute) => attribute.assembly);
builder.Services.AddModules(assembliesInAttribute.ToArray());
IEnumerable<Assembly> assemblies = GetPossibleModulesPaths().
Select(
(directory) =>
Expand Down

0 comments on commit 7860a64

Please sign in to comment.