Skip to content

Deprecate ForceEnc and migrate scenarios to DOTNET_MODIFIABLE_ASSEMBLIES #124017

@barosiak

Description

@barosiak

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

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:

image

Originally posted by @tmat in #123744

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions