未验证 提交 6c7d9359 编写于 作者: M Michal Strehovský 提交者: GitHub

Avoid calling into resource manager from the type loader (#70538)

Sample stack:

```
 	System.Runtime.Tests.exe!S_P_CoreLib_System_SR__GetResourceString() Line 29	Unknown
 	System.Runtime.Tests.exe!S_P_CoreLib_System_Exception__get_Message() Line 57	Unknown
 	System.Runtime.Tests.exe!S_P_CoreLib_System_Exception__AppendExceptionStackFrame() Line 134	Unknown
 	System.Runtime.Tests.exe!S_P_CoreLib_System_Runtime_EH__AppendExceptionStackFrameViaClasslib() Line 234	Unknown
 	System.Runtime.Tests.exe!S_P_CoreLib_System_Runtime_EH__UpdateStackTrace() Line 735	Unknown
 	System.Runtime.Tests.exe!S_P_CoreLib_System_Runtime_EH__DispatchEx() Line 630	Unknown
 	System.Runtime.Tests.exe!S_P_CoreLib_System_Runtime_EH__RhThrowEx() Line 571	Unknown
 	System.Runtime.Tests.exe!RhpThrowEx�()	Unknown
 	System.Runtime.Tests.exe!S_P_TypeLoader_Internal_TypeSystem_TypeDesc__ComputeTemplate_0() Line 241	Unknown
 	System.Runtime.Tests.exe!S_P_TypeLoader_Internal_TypeSystem_TypeDesc__ComputeTemplate() Line 233	Unknown
```
上级 0c3d5ad0
......@@ -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") { }
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册