-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Support equivalent of AssemblyBuilder.Save to save in-memory IL to an assembly #62956
Copy link
Copy link
Closed
Labels
Cost:LWork that requires one engineer up to 4 weeksWork that requires one engineer up to 4 weeksPriority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releaseTeam:LibrariesUser StoryA single user-facing feature. Can be grouped under an epic.A single user-facing feature. Can be grouped under an epic.area-System.Reflection.Emittenet-compatibilityIncompatibility with previous versions or .NET FrameworkIncompatibility with previous versions or .NET Framework
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
Cost:LWork that requires one engineer up to 4 weeksWork that requires one engineer up to 4 weeksPriority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releaseTeam:LibrariesUser StoryA single user-facing feature. Can be grouped under an epic.A single user-facing feature. Can be grouped under an epic.area-System.Reflection.Emittenet-compatibilityIncompatibility with previous versions or .NET FrameworkIncompatibility with previous versions or .NET Framework
The most common feature request in reflection, with 100+ upvotes, is to add support for equivalent
AssemblyBuilder.Save()functionality. Since this exists in .NET Desktop, some consider this an adoption blocker.Prototyping done in .NET 7.0 to investigate feasibility of adding the
Save()via an adapter fromAssemblyBuilderto the newerMetadataBuilderwhich supports writing IL to a Stream\file. Related issues:System.Reflection.Emit.AssemblyBuilder.Save
Unable to set EntryPoint on generated assemblies with System.Reflection.Emit
We plan to abstract out Reflection.Emit APIs in order to have two implementations, one that having old code to support all downlevel runtime, and a new implementation that replaces the current Reflection.Emit implementation with
AssemblyBuilder.Save()support, steps:ParameterBuilderandAssemblyBuilder.Save(string/stream)reviewed and approvedAssemblyBuilder.Save(string/stream)CustomAttributesfor all members like assembly/module (PR)Remaining work that out of .NET 8.0:
AssemblyBuilder.Save(string/stream)(mostly will rely on community contributions)SignatureCallingConvention,*RequiredCustomModifiers,*OptionalCustomModifiers)