Skip to content

EnC: Add support for updating ManifestResource table #115910

Open
@tmat

Description

@tmat

Description

Adding, updating or deleting a managed resource during Hot Reload/EnC currently requires restarting the application. To avoid that we need the runtime to allow changes to ManifestResource table.

Embedded resources listed in the ManifestResource table are stored in the resource section of the PE file, at an offset stored in the ManifestResource table. Similarly to FieldRVA implementation, we can store the blob in the IL delta stream in EnC delta and interpret the offset as a position in the IL stream.

Once implemented a new EnC capability ChangeManifestResources should be added.

The resource string cache also needs to be invalidated when Hot Reload change is applied: #115911

The following APIs should return the updated resources after change is applied:
https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getmanifestresourceinfo?view=net-9.0
https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getmanifestresourcenames?view=net-9.0
https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getmanifestresourcestream?view=net-9.0

Any Reflection caches that store the data need to be invalidated on Hot Reload update.

Reproduction Steps

Update .resx file during Hot Reload/EnC session.

Expected behavior

The change is applied without restarting application.

Actual behavior

The change is ignored.

Regression?

No

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Diagnostics-coreclrenhancementProduct code improvement that does NOT require public API changes/additions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions