Modulo the GUID in the assembly and the GUID embedded in some
field initializers that use the assembly GUID for their name, the
assemblies are idential before and after the patch.
Fixes#605033.
'cause stack overflow is back, mkay?
at System.Diagnostics.TraceImpl.InitOnce () <0x0005b>
at System.Diagnostics.TraceImpl.get_IndentLevel () <0x0000b>
at System.Diagnostics.TraceListenerCollection.InitializeListener (System.Diagnostics.TraceListener) <0x0000f>
at System.Diagnostics.TraceListenerCollection.Add (System.Diagnostics.TraceListener) <0x00017>
at System.Diagnostics.TraceListenerCollection..ctor (bool) <0x0007f>
at System.Diagnostics.TraceListenerCollection..ctor () <0x00013>
at System.Diagnostics.DiagnosticsConfigurationHandler.GetSharedListeners (System.Collections.IDictionary) <0x00083>
at System.Diagnostics.DiagnosticsConfigurationHandler.Create (object,object,System.Xml.XmlNode) <0x003cf>
at System.Configuration.ConfigurationSection.GetRuntimeObject () <0x0033d>
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (string) <0x00041>
at System.Configuration.ConfigurationManager.GetSection (string) <0x00030>
at System.Configuration.ConfigurationSettings.GetConfig (string) <0x0000f>
at System.Diagnostics.DiagnosticsConfiguration.get_Settings () <0x00043>
at System.Diagnostics.TraceImpl.InitOnce () <0x0005b>
Thus, when we're getting the <sharedListeners/> element, we shouldn't call
the TraceListenerCollection default constructor, as that will attempt to add
the DefaultTraceListener (which isn't needed anyway, as the
DefaultTraceListener is explicitly added by TraceImplSettings).
TraceSourceInfo(string, SourceLevels, TraceImplSettings) constructor.
* System.Diagnostics/TraceSourceInfo.cs: Add a new constructor,
TraceSourceInfo(string, SourceLevels, TraceImplSettings), which adds
the DefaultTraceListener w/o depending upon (the possibly still
initializing) TraceImpl members. Fixes#502944.
* Test/test-config-file: Add a /configuration/system.diagnostics/source
section to elicit the buggy behavior found in #502944.
svn path=/trunk/mcs/; revision=133981
while reading the .config file, instead cache the values and refer
to the cached values during initialization. This prevents recursive
initialization calls (Trace.OnInit() ... Trace.Listeners.Add() ...
Trace.OnInit() ...), and associated duplicate parsing of .config file
sections. Fixes bnc#499442.
* TraceImpl.cs: Cope with DiagnosticsConfigurationHandler changes.
* TraceListenerCollection.cs: Add internal
Add(TraceListener,TraceImplSettings) method for adding
TraceListeners during DiagnosticsConfigurationHandler initialization
(which can't access TraceImpl, as we may still be reading the
.config file to determine the TraceImpl values).
svn path=/trunk/mcs/; revision=133291
* ConsoleTraceListener.cs: add an internal constructor that takes a
string argument. Used when 'initializeData' is set.
* DiagnosticsConfigurationHandler.cs: try internal constructors when
the assembly is System.
Fixes bug #498853.
svn path=/trunk/mcs/; revision=132868
* DelimitedTraceListener.cs: Changed accessibility of
GetSupportedAttributes to protected internal.
* DiagnosticsConfigurationHandler.cs: Use GetSupportedAttributes to
allow custom attributes on tracelisteners. Fixes bug #413203.
* TraceListener.cs: Changed accessibility of GetSupportedAttributes
to protected internal. Removed MonoTODO on GetSupportedAttributes and
Attributes. Fixed line endings.
svn path=/trunk/mcs/; revision=109500
ConfigurationErrorsException when any attribute other than 'Name'
is found when referencing a shared listener. Fixes bug #404054.
Added support for the traceOutputOptions attribute on 2.0 profile.
Fixes bug #403583.
* ConfigXmlDocument.cs: Implement IConfigErrorInfo on all Node classes.
svn path=/trunk/mcs/; revision=106628
to GetSwitchValue. On 2.0 profile, leave the type conversion to
Switch implementations. Minor corrections to exception messages to
match MS.
* Switch.cs: Avoid unnecessary inits. On 2.0 profile, catch and
rethrow exceptions in setter for Value. Do not hide exceptions thrown
in GetConfigFileSetting. Only set value from config file if switch is
actually defined.
* SourceSwitch.cs: Use SwitchSetting for getting/storing value instead
of new field. In OnValueChanged, parse enum value.
* TraceSwitch.cs: If SwitchSetting is changed to value > 4, then set
it to Verbose. In OnValueChanged, parse value case-insensitively, and
assign it to SwitchSetting (to allow other integral values).
svn path=/trunk/mcs/; revision=86141
* TraceSourceInfo.cs : new class for storing configuration data.
* TraceSource.cs : TraceEventCache arguments should be null (they are
nullable). Use TraceSourceInfo above.
* DiagnosticsConfigurationHandler.cs : removed hack to store listeners
in named sources, not traceimpl. Create TraceSource objects from
configuration data.
* System.dll.sources : added TraceSourceInfo.cs.
svn path=/trunk/mcs/; revision=77640
* XmlWriterTraceListener.cs : open file in shared r/w mode.
* DiagnosticsConfigurationHandler.cs : process <sharedListeners>
elements first, so that named listeners work fine.
* EventLogTraceListener.cs : added 2.0 stubs.
* CorrelationManager.cs : removed todo.
svn path=/trunk/mcs/; revision=77625
Use a lock-free algorithm for creating the settings information.
* TraceImpl.cs (InitOnce): Use a lock-free algorithm for creating the
listeners collection and initializing the world.
svn path=/trunk/mcs/; revision=39098
/system.diagnostics/switch/add/@value attribute only contain numeric data and
some other fixes (thread-safety in the Debug- and Trace-related classes).
* System/System.Diagnostics/DiagnosticsConfigurationHandler.cs
(DiagnosticsConfiguration): Don't read the .config file from the
static ctor (again), as if it fails we'll get a TypeLoadException -- bad! Instead, lazy-read the .config file.
* System/System.Diagnostics/DiagnosticsConfigurationHandler.cs
(DiagnosticsConfigurationHandler): Require that the /switch/add/@value
attribute contains only numeric values.
* System/System.Diagnostics/DiagnosticsConfigurationHandler.cs:
* System/System.Diagnostics/TraceImpl.cs: Don't initialize everything in
the static ctor, as if it fails (due to an invalid .confg file) we get a
TypeLoadException, while .NET generates a ConfigurationException.
Instead, initialize everything the first time the Listeners property is
accessed, which allows the static ctor to run without chance of failure,
avoiding the TypeLoadException.
* System/System.Diagnostics/TraceListenerCollection.cs: This should be
thread-safe, as it's accessible from a static member of TraceImpl
(available through the public Debug and Trace classes).
* System/System.Diagnostics/Switch.cs: Leave the original switch value alone.
If it isn't valid (i.e. numeric), the DiagnosticsConfigurationHandler
will catch it.
* System/Test/test-config-file: Remove "string-value" switch, as it causes
ConfigurationExceptions under .NET 1.1 (the value attribute can't be
non-numeric), and Mono now follows this behavior. Add a "custom-switch"
value, which is used in the regression tests.
* System/Test/System.Diagnostics/DiagnosticsConfigurationHandlerTest.cs:
.NET 1.1 requires that the value attribute be a numeric value; check for
that and update the success test so that they'll actually pass.
* System/Test/System.Diagnostics/SwitchesTest.cs: TestNewSwitch reads
"custom-switch" now, and the switches value is now "42", not "0".
Remove warning about unused variable.
svn path=/trunk/mcs/; revision=39090
configuration element /switches/add/@value attribute is now *required*, not
optional (as it was under .NET 1.0).
* System/System.Diagnostics/DiagnosticsConfigurationHandler.cs:
The /switch/add/@value attribute isn't optional under .NET 1.1, so make
sure it exists.
* System/Test/test-config-file: Remove <add/> elements lacking a value
attribute. .NET 1.1 doesn't support this anymore, and neither does Mono.
* System/Test/System.Diagnostics/DiagnosticsConfigurationHandlerTest.cs:
.NET 1.1 doesn't permit <add/> elements without a value attribute.
Assert the same under Mono.
svn path=/trunk/mcs/; revision=39046
thread-safe (double-checked locking isn't thread safe on .NET without
using a volatile variable, and setting the variable in the static
constructor is easier anyway).
* Switch.cs (GetConfigFileSetting): If the setting is non-numeric, set the
attribute value to the string "0". This is apparently what .NET 1.1 does,
and allows the SwitchTest NUnit test to work w/o failures.
svn path=/trunk/mcs/; revision=38902
constructor that only takes one string as parameter to construct the
listener. The name is set using the Name property, not the constructor.
* TextWriterTraceListener.cs: In Write*, do nothing if no writer was
provided.
svn path=/trunk/mcs/; revision=25105
* DiagnosticsConfigurationHandler.cs: Removed a never used variable
* EventLog.cs: Small update to prevent a warning
* EventLogPermission.cs: Implemented or implementation added
* EventLogPermissionAttribute.cs: Implemented or implementation added
* EventLogPermissionEntry.cs: Implemented or implementation added
* EventLogPermissionEntryCollection.cs: Implemented or implementation added
* EventLogTraceListener.cs: Implemented or implementation added
* PerformanceCounterManager.cs: Implemented or implementation added
* PerformanceCounterInstaller.cs: Made internal
* PerformanceCounterCategory.cs: Implemented few members
* PerformanceCounterPermission.cs: Implemented or implementation added
* PerformanceCounterPermissionAttribute.cs: Implemented or implementation added
* PerformanceCounterPermissionEntry.cs: Implemented or implementation added
* PerformanceCounterPermissionEntryCollection.cs: Implemented or implementation added
svn path=/trunk/mcs/; revision=16177
Don't assume that optional attributes are always present
<assert/> can't have any child nodes
Change in semantics: if the attribute isn't present, GetAttribute()
returns null, not "". This allows us to differentiate between an attribute
not being present and an attribute with an empty value.
Translate exceptions if a TraceListener type is invalid
ChangeLog: Update for the previous changes I forgot to record
svn path=/trunk/mcs/; revision=9806
Switch derived classes should match that of .NET.
Go forth and use Swiches! ;-)
ChangeLog:
* BooleanSwitch.cs: Complete re-write. It works now.
* DefaultTraceListener.cs:
- Use `const' strings, so I don't worry about copy/paste errors
- Give `AssertUiEnabled' an actual backing member
* DiagnosticsConfigurationHandler.cs: To avoid race conditions, let the
configuration handler set .config-specified properties on
DefaultTraceListener (AssertUiEnabled, LogFileName) and TraceImpl
(AutoFlush, IndentSize).
* Switch.cs: Near complete re-write. Actually works, and is (should be)
comformant with .NET behavior. Changed member names because they were
confusing me. (Yes, that doesn't say much about my memory.)
* TextWriterTraceListener.cs: Append text to already existing files, don't
overwrite them.
* TraceImpl.cs:
- Added private destructor, to ensure no instances are created.
- Move members declarations to be closer to each other.
* TraceSwitch.cs: Complete re-write. It works now.
svn path=/trunk/mcs/; revision=9747