diff --git a/Src/Microsoft.Dynamic/Utils/ReflectionUtils.cs b/Src/Microsoft.Dynamic/Utils/ReflectionUtils.cs index 50d0482c..a6ba606a 100644 --- a/Src/Microsoft.Dynamic/Utils/ReflectionUtils.cs +++ b/Src/Microsoft.Dynamic/Utils/ReflectionUtils.cs @@ -1144,7 +1144,9 @@ public static void CopyMethodSignature(MethodInfo from, MethodBuilder to, bool s for (int i = 0; i < paramInfos.Length; i++) { var parameterBuilder = to.DefineParameter(i + 1, paramInfos[i].Attributes, paramInfos[i].Name); - if (paramInfos[i].HasDefaultValue) parameterBuilder.SetConstant(paramInfos[i].RawDefaultValue); + try { // ParameterBuilder.SetConstant is buggy and may fail on Mono + if (paramInfos[i].HasDefaultValue) parameterBuilder.SetConstant(paramInfos[i].RawDefaultValue); + } catch { } } }