Skip to content

Commit

Permalink
Use a more descriptive dynamic assembly name even when the ALC's name…
Browse files Browse the repository at this point in the history
… is empty.
  • Loading branch information
teo-tsirpanis committed Nov 27, 2021
1 parent 1a143d6 commit 62afbe1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private sealed class ProxyAssembly
public ProxyAssembly(AssemblyLoadContext alc)
{
string? alcName = alc.Name;
string name = alcName is null ? $"DispatchProxyTypes.{alc.GetHashCode()}" : $"DispatchProxyTypes.{alcName}";
string name = string.IsNullOrEmpty(alcName) ? $"DispatchProxyTypes.{alc.GetHashCode()}" : $"DispatchProxyTypes.{alcName}";
_ab = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName(name), AssemblyBuilderAccess.RunAndCollect);
_mb = _ab.DefineDynamicModule("MainModule");
}
Expand Down

0 comments on commit 62afbe1

Please sign in to comment.