diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs
index d949a826e1..cff16b0c4d 100644
--- a/src/System.Management.Automation/engine/parser/Parser.cs
+++ b/src/System.Management.Automation/engine/parser/Parser.cs
@@ -4370,49 +4370,49 @@ namespace System.Management.Automation.Language
switch (token.Kind)
{
#if SUPPORT_PUBLIC_PRIVATE
- case TokenKind.Public:
- if (publicToken != null)
- {
- ReportError(token.Extent,
- nameof(ParserStrings.DuplicateQualifier),
- ParserStrings.DuplicateQualifier,
- token.Text);
- }
+ case TokenKind.Public:
+ if (publicToken != null)
+ {
+ ReportError(token.Extent,
+ nameof(ParserStrings.DuplicateQualifier),
+ ParserStrings.DuplicateQualifier,
+ token.Text);
+ }
- if (privateToken != null)
- {
- ReportError(token.Extent,
- nameof(ParserStrings.ModifiersCannotBeCombined),
- ParserStrings.ModifiersCannotBeCombined,
- privateToken.Text,
- token.Text);
- }
+ if (privateToken != null)
+ {
+ ReportError(token.Extent,
+ nameof(ParserStrings.ModifiersCannotBeCombined),
+ ParserStrings.ModifiersCannotBeCombined,
+ privateToken.Text,
+ token.Text);
+ }
- publicToken = token;
- SkipToken();
- break;
+ publicToken = token;
+ SkipToken();
+ break;
- case TokenKind.Private:
- if (privateToken != null)
- {
- ReportError(token.Extent,
- nameof(ParserStrings.DuplicateQualifier),
- ParserStrings.DuplicateQualifier,
- token.Text);
- }
+ case TokenKind.Private:
+ if (privateToken != null)
+ {
+ ReportError(token.Extent,
+ nameof(ParserStrings.DuplicateQualifier),
+ ParserStrings.DuplicateQualifier,
+ token.Text);
+ }
- if (publicToken != null)
- {
- ReportError(token.Extent,
- nameof(ParserStrings.ModifiersCannotBeCombined),
- ParserStrings.ModifiersCannotBeCombined,
- publicToken.Text,
- token.Text);
- }
+ if (publicToken != null)
+ {
+ ReportError(token.Extent,
+ nameof(ParserStrings.ModifiersCannotBeCombined),
+ ParserStrings.ModifiersCannotBeCombined,
+ publicToken.Text,
+ token.Text);
+ }
- privateToken = token;
- SkipToken();
- break;
+ privateToken = token;
+ SkipToken();
+ break;
#endif
case TokenKind.Hidden:
@@ -4529,7 +4529,7 @@ namespace System.Management.Automation.Language
return null;
}
-#if FALSE
+#if SUPPORT_PUBLIC_PRIVATE
MethodAttributes attributes = privateToken != null ? MethodAttributes.Private : MethodAttributes.Public;
#else
MethodAttributes attributes = MethodAttributes.Public;
diff --git a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs
index 55c3427512..f67cbab7a7 100644
--- a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs
+++ b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs
@@ -79,7 +79,7 @@ namespace System.Management.Automation.Language
internal static BindingRestrictions GetSimpleTypeRestriction(this DynamicMetaObject obj)
{
- if (obj.Value == null || ClrFacade.IsTransparentProxy(obj.Value))
+ if (obj.Value == null)
{
return BindingRestrictions.GetInstanceRestriction(obj.Expression, obj.Value);
}
@@ -132,7 +132,7 @@ namespace System.Management.Automation.Language
return obj.Restrictions;
}
- if (obj.Value == null || ClrFacade.IsTransparentProxy(obj.Value))
+ if (obj.Value == null)
{
return BindingRestrictions.GetInstanceRestriction(obj.Expression, obj.Value);
}
@@ -187,7 +187,7 @@ namespace System.Management.Automation.Language
return obj.Restrictions;
}
- if (obj.Value == null || ClrFacade.IsTransparentProxy(obj.Value))
+ if (obj.Value == null)
{
return BindingRestrictions.GetInstanceRestriction(obj.Expression, obj.Value);
}
@@ -6878,14 +6878,6 @@ namespace System.Management.Automation.Language
argValues[i] = arg == AutomationNull.Value ? null : arg;
}
- if (ClrFacade.IsTransparentProxy(target.Value) && (psMethodInvocationConstraints == null || psMethodInvocationConstraints.MethodTargetType == null))
- {
- var argTypes = (psMethodInvocationConstraints == null)
- ? new Type[numArgs]
- : psMethodInvocationConstraints.ParameterTypes.ToArray();
- psMethodInvocationConstraints = new PSMethodInvocationConstraints(target.Value.GetType(), argTypes);
- }
-
var result = Adapter.FindBestMethod(
mi,
psMethodInvocationConstraints,
diff --git a/src/System.Management.Automation/utils/ClrFacade.cs b/src/System.Management.Automation/utils/ClrFacade.cs
index 9feafe40d4..43be8e6aa3 100644
--- a/src/System.Management.Automation/utils/ClrFacade.cs
+++ b/src/System.Management.Automation/utils/ClrFacade.cs
@@ -280,19 +280,6 @@ namespace System.Management.Automation
#region Misc
- ///
- /// Facade for RemotingServices.IsTransparentProxy(object)
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- internal static bool IsTransparentProxy(object obj)
- {
-#if CORECLR // Namespace System.Runtime.Remoting is not in CoreCLR
- return false;
-#else
- return System.Runtime.Remoting.RemotingServices.IsTransparentProxy(obj);
-#endif
- }
-
///
/// Facade for ManagementDateTimeConverter.ToDmtfDateTime(DateTime)
///