From a851190e05af9b6ded646c1eec65c0b5cc118910 Mon Sep 17 00:00:00 2001 From: Markus Kitsinger Date: Tue, 29 Jan 2019 22:57:23 -0600 Subject: Cherry pick c4ad39544d999590698ce44beab8aa0d7aa79612 --- .../Runtime/AmbiguousImplementationException.cs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs (limited to 'src/System.Private.CoreLib') diff --git a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs new file mode 100644 index 000000000..a9d0eeb63 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Runtime; +using System.Globalization; + +namespace System.Runtime.Serialization +{ + [Serializable] + public sealed class AmbiguousImplementationException : Exception + { + public AmbiguousImplementationException() + : base(SR.AmbiguousImplementationException_NullMessage) + { + } + + public AmbiguousImplementationException(string message) + : base(message) + { + } + + public AmbiguousImplementationException(string message, Exception innerException) + : base(message, innerException) + { + } + + private AmbiguousImplementationException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } +} -- cgit v1.2.3 From 1db45a411293d1c7ac09f7b071228fa9e8906b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 30 Jan 2019 13:41:44 +0100 Subject: Fix namespace of the AmbiguousImplementationException (#22291) Moving to the namespace that was approved in dotnet/corefx#34124. Signed-off-by: dotnet-bot --- .../shared/System/Runtime/AmbiguousImplementationException.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/System.Private.CoreLib') diff --git a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs index a9d0eeb63..4358c65a8 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs @@ -2,10 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Runtime; using System.Globalization; +using System.Runtime.Serialization; -namespace System.Runtime.Serialization +namespace System.Runtime { [Serializable] public sealed class AmbiguousImplementationException : Exception -- cgit v1.2.3 From ef45232b9efb735c9f83774fd069bb6367a96854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Sun, 3 Feb 2019 19:22:32 +0100 Subject: Throw the right exception when interface dispatch is ambiguous (#22295) Throw the approved exception per dotnet/corefx#34124. Signed-off-by: dotnet-bot --- src/System.Private.CoreLib/shared/System/HResults.cs | 1 + .../shared/System/Runtime/AmbiguousImplementationException.cs | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src/System.Private.CoreLib') diff --git a/src/System.Private.CoreLib/shared/System/HResults.cs b/src/System.Private.CoreLib/shared/System/HResults.cs index 4a5ec0d63..9c8db2143 100644 --- a/src/System.Private.CoreLib/shared/System/HResults.cs +++ b/src/System.Private.CoreLib/shared/System/HResults.cs @@ -27,6 +27,7 @@ namespace System { internal const int S_OK = unchecked((int)0x00000000); internal const int COR_E_ABANDONEDMUTEX = unchecked((int)0x8013152D); + internal const int COR_E_AMBIGUOUSIMPLEMENTATION = unchecked((int)0x8013106A); internal const int COR_E_AMBIGUOUSMATCH = unchecked((int)0x8000211D); internal const int COR_E_APPDOMAINUNLOADED = unchecked((int)0x80131014); internal const int COR_E_APPLICATION = unchecked((int)0x80131600); diff --git a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs index 4358c65a8..1a7ef0aef 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs @@ -13,16 +13,19 @@ namespace System.Runtime public AmbiguousImplementationException() : base(SR.AmbiguousImplementationException_NullMessage) { + HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION; } public AmbiguousImplementationException(string message) : base(message) { + HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION; } public AmbiguousImplementationException(string message, Exception innerException) : base(message, innerException) { + HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION; } private AmbiguousImplementationException(SerializationInfo info, StreamingContext context) -- cgit v1.2.3 From 02ca54592d5df11f4088954c552b42b15df4279f Mon Sep 17 00:00:00 2001 From: Maryam Ariyan Date: Tue, 5 Mar 2019 11:36:02 -0800 Subject: Add Type Forward (dotnet/coreclr#23036) Signed-off-by: dotnet-bot --- .../shared/System/Runtime/AmbiguousImplementationException.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/System.Private.CoreLib') diff --git a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs index 1a7ef0aef..9e43ec019 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs @@ -8,6 +8,7 @@ using System.Runtime.Serialization; namespace System.Runtime { [Serializable] + [System.Runtime.CompilerServices.TypeForwardedFrom("System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] public sealed class AmbiguousImplementationException : Exception { public AmbiguousImplementationException() -- cgit v1.2.3 From d35abeee77150e625499f6f75f00c4945635cf15 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Tue, 29 Jan 2019 22:38:57 -0800 Subject: Add resource string --- src/System.Private.CoreLib/src/Resources/Strings.resx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/System.Private.CoreLib') diff --git a/src/System.Private.CoreLib/src/Resources/Strings.resx b/src/System.Private.CoreLib/src/Resources/Strings.resx index 8c132237e..f161741e3 100644 --- a/src/System.Private.CoreLib/src/Resources/Strings.resx +++ b/src/System.Private.CoreLib/src/Resources/Strings.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Ambiguous implementation found. + Cannot access member. -- cgit v1.2.3 From 8cb8b23e1a3012b8a945d8c8de6e279c6a56b491 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 18 Apr 2019 18:35:42 +0200 Subject: Update AmbiguousImplementationException.cs --- .../shared/System/Runtime/AmbiguousImplementationException.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'src/System.Private.CoreLib') diff --git a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs index 9e43ec019..1a7ef0aef 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs @@ -8,7 +8,6 @@ using System.Runtime.Serialization; namespace System.Runtime { [Serializable] - [System.Runtime.CompilerServices.TypeForwardedFrom("System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] public sealed class AmbiguousImplementationException : Exception { public AmbiguousImplementationException() -- cgit v1.2.3