summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs')
-rw-r--r--src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs b/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs
index f6415670e3..d4ce9a9ab9 100644
--- a/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs
+++ b/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs
@@ -27,7 +27,10 @@ namespace System.IO
GetFileLoadExceptionMessage(hResult, JitHelpers.GetStringHandleOnStack(ref format));
string message = null;
- GetMessageForHR(hResult, JitHelpers.GetStringHandleOnStack(ref message));
+ if (hResult == System.__HResults.COR_E_BADEXEFORMAT)
+ message = SR.Arg_BadImageFormatException;
+ else
+ GetMessageForHR(hResult, JitHelpers.GetStringHandleOnStack(ref message));
return string.Format(CultureInfo.CurrentCulture, format, fileName, message);
}