diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs index 9c1c186f66e86b907e5a792933cc959dace1d846..54e2ac88e08ab44368261c5aa2e79d834fb3c222 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs @@ -105,6 +105,10 @@ public TypeBuilder() // Helper exception to abort type building if we do not find the generic type template internal class MissingTemplateException : Exception { + public MissingTemplateException() + // Cannot afford calling into resource manager from here, even to get the default message for System.Exception. + // This exception is always caught and rethrown as something more user friendly. + : base("Template is missing") { } }