Deprecate ForceEnc and migrate scenarios to DOTNET_MODIFIABLE_ASSEMBLIES
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
`ForceEnc()` is an undocumented switch that doesn't work correctly. The runtime now has a documented and correct mechanism to control metadata updates / EnC via `DOTNET_MODIFIABLE_ASSEMBLIES` (values: `debug`, `none`). We should remove usage of ForceEnc by migrating any remaining uses to `DOTNET_MODIFIABLE_ASSEMBLIES`.
> ForceEnc has been undocumented testing hack that does not work correctly. We have introduced ModifiableAssemblies env var as something that works correctly and that is documented.
>
> If there are still tests somewhere that depend on ForceEnc, they are not testing shipping scenario and they should be better switched to ModifiableAssemblies env var or deleted.
_Originally posted by @jkotas in [#123744](https://github.com/dotnet/runtime/pull/123744/changes/BASE..01e1d75cac44565c5b90cf3ab7061c421bb5d1ba#r2762951653)_
Additionally, Visual Studio attach-time error messaging currently suggests `COMPLUS_ForceENC`. This should be addressed in the VS repo as a follow-up: it should suggest `DOTNET_MODIFIABLE_ASSEMBLIES=debug` instead for .NET apps.
> When VS attaches to a process that's not launched from VS and the user tries to apply changes VS displays error mentioning COMPLUS_ForceENC:
>
>
_Originally posted by @tmat in [#123744](https://github.com/dotnet/runtime/pull/123744/changes/BASE..01e1d75cac44565c5b90cf3ab7061c421bb5d1ba#r2765043218)_
Contributor guide
Assessment
This issue has not been assessed yet.