I'm using multiple ZyanConnections with different servers. Connections created in paralel by Tasks. Sometimes I get exception with message "Remoting custom errors mode had already been set". As I understand it's happening because every IClientProtocolSetup implementation set RemotingConfiguration.CustomErrorsMode static property and exception is generating on second invoke. There is data race:
```
if (RemotingConfiguration.CustomErrorsMode != CustomErrorsModes.Off)
{
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;
}
```
What about some lock or try/catch (because property already set and we can ignore exception)?
```
if (RemotingConfiguration.CustomErrorsMode != CustomErrorsModes.Off)
{
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;
}
```
What about some lock or try/catch (because property already set and we can ignore exception)?