Description
When running without a debugger attached, we need a way to tell the runtime that certain assemblies will be modified with EnC deltas. For Mono we need to do this early enough that we set the right interpreter optimization flags before we execute any managed code from the affected assemblies.
The information given to the runtime should probably include the set of assemblies that will be modified (as opposed to informing the runtime that any assembly at all could potentially be modified).
The current proposal:
Pass an environment variable DOTNET_MODIFIABLE_ASSEMBLIES
with the case-insensitive keyword "debug" to enable all debug built assemblies for hot reload. This can be expanded on with other keywords like "all" or a comma separated list of assemblies when there are clear scenarios for the options.
Alternative approaches:
- Pass a new
MODIFIABLE_ASSEMBLIES
property tocoreclr_initialize
that includes a list of assemblies that the runtime should expect to be modified. The presence of the property would indicate that hot reload support should be enabled. We could pass the property via the.runtimeconfig.dev.json
file without any modifications to the (desktop) host. Mobile and wasm workloads would need to adjust their hosts. - Pass an environment variable
DOTNET_MODIFIABLE_ASSEMBLIES
with the same information. On mobile and wasm workloads, the hosts wouldn't need to be adjusted, MonoVM would consult the environment variable itself. On other workloads the host could interpret the environment variable or leave it to the runtimes.