本文整理汇总了C#中System.Diagnostics.TraceSource.TraceError方法的典型用法代码示例。如果您正苦于以下问题:C# TraceSource.TraceError方法的具体用法?C# TraceSource.TraceError怎么用?C# TraceSource.TraceError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Diagnostics.TraceSource
的用法示例。
在下文中一共展示了TraceSource.TraceError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ServiceBusConnection
public ServiceBusConnection(ServiceBusScaleoutConfiguration configuration, TraceSource traceSource)
{
_trace = traceSource;
_connectionString = configuration.BuildConnectionString();
try
{
_namespaceManager = NamespaceManager.CreateFromConnectionString(_connectionString);
_factory = MessagingFactory.CreateFromConnectionString(_connectionString);
if (configuration.RetryPolicy != null)
{
_factory.RetryPolicy = configuration.RetryPolicy;
}
else
{
_factory.RetryPolicy = RetryExponential.Default;
}
}
catch (ConfigurationErrorsException)
{
_trace.TraceError("The configured Service Bus connection string contains an invalid property. Check the exception details for more information.");
throw;
}
_backoffTime = configuration.BackoffTime;
_idleSubscriptionTimeout = configuration.IdleSubscriptionTimeout;
_configuration = configuration;
}
示例2: ServiceBusConnection
public ServiceBusConnection(ServiceBusScaleoutConfiguration configuration, TraceSource traceSource)
{
_trace = traceSource;
try
{
_namespaceManager = NamespaceManager.CreateFromConnectionString(configuration.ConnectionString);
}
catch (ConfigurationErrorsException ex)
{
_trace.TraceError("Invalid connection string '{0}': {1}", configuration.ConnectionString, ex.Message);
throw;
}
_factory = MessagingFactory.CreateFromConnectionString(configuration.ConnectionString);
_configuration = configuration;
}