From cf4aea9858f1b4a58f3f7b406856e5d41022e971 Mon Sep 17 00:00:00 2001 From: Stephen Bonikowsky Date: Fri, 4 Sep 2015 14:14:23 -0700 Subject: [PATCH] Fix for Issue #315 Fixes #315 --- .../ServiceModel/Description/ServiceReflector.cs | 12 +++++++++++- .../tests/Description/OperationBehaviorTest.cs | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/System.Private.ServiceModel/src/System/ServiceModel/Description/ServiceReflector.cs b/src/System.Private.ServiceModel/src/System/ServiceModel/Description/ServiceReflector.cs index 587bac44b2e..e4db295ac09 100644 --- a/src/System.Private.ServiceModel/src/System/ServiceModel/Description/ServiceReflector.cs +++ b/src/System.Private.ServiceModel/src/System/ServiceModel/Description/ServiceReflector.cs @@ -457,7 +457,17 @@ static internal object[] GetCustomAttributes(CustomAttributeProvider attrProvide } else { - return Array.Empty(); + List attrTypeAttributes = new List(); + object[] allCustomAttributes = attrProvider.GetCustomAttributes(inherit); + foreach (object customAttribute in allCustomAttributes) + { + if (attrType.IsAssignableFrom(customAttribute.GetType())) + { + attrTypeAttributes.Add(customAttribute); + } + } + + return attrTypeAttributes.ToArray(); } } catch (Exception e) diff --git a/src/System.ServiceModel.Primitives/tests/Description/OperationBehaviorTest.cs b/src/System.ServiceModel.Primitives/tests/Description/OperationBehaviorTest.cs index 9906cebbcf6..d39021ddf1a 100644 --- a/src/System.ServiceModel.Primitives/tests/Description/OperationBehaviorTest.cs +++ b/src/System.ServiceModel.Primitives/tests/Description/OperationBehaviorTest.cs @@ -8,7 +8,6 @@ public static class OperationBehaviorTest { [Fact] - [ActiveIssue(315)] public static void IOperationBehavior_Methods_AreCalled() { DuplexClientBase duplexService = null;