Common.Logging.ETW.ETWLoggerFactoryAdapter.ThrowIfDuplicateEventSourceTypeRegistrationNotPermitted C# (CSharp) Метод

ThrowIfDuplicateEventSourceTypeRegistrationNotPermitted() приватный Метод

private ThrowIfDuplicateEventSourceTypeRegistrationNotPermitted ( Type eventSourceType ) : void
eventSourceType System.Type
Результат void
        private void ThrowIfDuplicateEventSourceTypeRegistrationNotPermitted(Type eventSourceType)
        {
            if (!_permitDuplicateEventSourceRegistration)
            {
                var message = new StringBuilder();
                message.AppendLine("Error attempting to register an instance of type " + eventSourceType.FullName + " as an EventSource on the ETWLoggerFactoryAdapters.");
                message.AppendLine("Attempting to register an EventSource-derived subclass with the adapter that has already been registered is not supported.");
                message.AppendLine("By default, Common.Logging will not permit more than a single registration of each EventSource subclass across all ETWLoggerFactoryAdapters in a single AppDomain.");
                message.AppendLine("For more details as to the reasoning for this constraint, see https://github.com/net-commons/common-logging/issues/125");
                message.AppendLine("To opt out of Common.Logging\'s enforcement of this constraint (at your own risk), set <arg key=\'permitDuplicateEventSourceRegistration\' value=\'true\'/>  in your config file.");


                throw new InvalidOperationException(message.ToString());
            }
        }