I'm using multiple ZyanConnections with different servers. Connections created in parallel 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)?
Comments: ** Comment from web user: yallie **
```
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)?
Comments: ** Comment from web user: yallie **
I think you're right that it's a threading issue.
I'm going to add a lock to protect this flag.
Thanks for reporting!