Skip to content

Commit

Permalink
Addressing static code analysis issue (#2470)
Browse files Browse the repository at this point in the history
* Addressing static code analysis issue: Add CultureInfo to 'Type.InvokeMember' calls

* Addressing code review feedback

* Fixed build break
  • Loading branch information
SteveL-MSFT authored and mirichmo committed Oct 13, 2016
1 parent c0f1d85 commit 9e47ad4
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -11,6 +11,7 @@
using System.Runtime.InteropServices;
using System.Diagnostics.CodeAnalysis;
using System.Management.Automation.Internal;
using System.Globalization;

namespace System.Management.Automation.Remoting
{
Expand Down Expand Up @@ -459,8 +460,8 @@ public sealed class WSManPluginManagedEntryWrapper
object[] blockLongPathsSwitch = new object[] { "Switch.System.IO.BlockLongPaths", false };
object[] useLegacyPathHandlingSwitch = new object[] { "Switch.System.IO.UseLegacyPathHandling", false };

appContextType.InvokeMember("SetSwitch", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.InvokeMethod, null, null, blockLongPathsSwitch);
appContextType.InvokeMember("SetSwitch", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.InvokeMethod, null, null, useLegacyPathHandlingSwitch);
appContextType.InvokeMember("SetSwitch", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.InvokeMethod, null, null, blockLongPathsSwitch, CultureInfo.InvariantCulture);
appContextType.InvokeMember("SetSwitch", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.InvokeMethod, null, null, useLegacyPathHandlingSwitch, CultureInfo.InvariantCulture);
}
catch (Exception e)
{
Expand Down

0 comments on commit 9e47ad4

Please sign in to comment.