简体   繁体   中英

.NET Remoting string comparison behaviour after Windows 10 update

I have a .NET remoting client/server application where my remote object has a method that returns a Dictionary as follows:

   public Dictionary<string, string> Test()
    {
        Dictionary<string, string> d = new Dictionary<string, string>(StringComparer.CurrentCultureIgnoreCase);

        d.Add("name", "test");

        return d;
    }

When this remote method is called by a client machine running Windows 10 with update 1709 (fall creator's update), the key lookup is no longer case insensitive, ie ContainsKey("Name") returns false.

This was not the case before update 1709 or if update 1709 is reverted. Also, if the string comparer is changed to StringComparer.OrdinalIgnoreCase (changing the server side only), ContainsKey("Name") returns true.

Both client and server are using the same region and language settings (English Ireland en-IE). Has something changed in this Windows update to cause this behaviour?

This might work for you.

public Dictionary<string, string> Test()
{
    Dictionary<string, string> d = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);

    d.Add("name", "test");

    return d;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM