Skip to content

Commit

Permalink
FIX AOT?
Browse files Browse the repository at this point in the history
  • Loading branch information
MeikelLP committed Sep 19, 2024
1 parent bd67e46 commit 40d687a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Core/Extensions/ServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public static IServiceCollection AddCoreServices(this IServiceCollection service
services.AddSingleton<IPacketManager>(provider =>
{
var packetTypes = AppDomain.CurrentDomain.GetAssemblies()
.Where(x => !x.IsDynamic) // ignore Castle.Core proxies
.SelectMany(x => x.GetExportedTypes())
.Where(x => x.GetName().Name?.StartsWith("DynamicProxyGenAssembly") ==
false) // ignore Castle.Core proxies
.SelectMany(x => x.ExportedTypes)
.Where(x => x.IsAssignableTo(typeof(IPacketSerializable)) &&
x.GetCustomAttribute<PacketAttribute>()?.Direction.HasFlag(EDirection.Incoming) == true)
.OrderBy(x => x.FullName)
Expand Down

0 comments on commit 40d687a

Please sign in to comment.