This repository was archived by the owner on Feb 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
InspectAll fails when Event has multiple DateTime fieldsΒ #101
Copy link
Copy link
Open
Description
Example event:
[Event(1, Level = EventLevel.Informational)]
public void ExampleEvent(
DateTime datetime1,
DateTime datetime2)
{
this.WriteEvent(datetime1, datetime2);
}
The analyzer throws:
System.FormatException: 1 is not a valid value for DateTime ---> System.FormatException: String was not recognized as a valid DateTime.
Result StackTrace:
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.ComponentModel.DateTimeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
--- End of inner exception stack trace ---
at System.ComponentModel.DateTimeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility.TypeExtensions.NotDefault(Type type)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility.EventSourceAnalyzer.TryInvokeMethod(EventSchema eventSchema, EventSource source, ProbeEventListener listener, MethodInfo& method)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility.EventSourceAnalyzer.ProbeEvent(EventSchema eventSchema, EventSource source)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility.EventSourceAnalyzer.Inspect(EventSource eventSource)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility.EventSourceAnalyzer.InspectAll(EventSource eventSource)
at
When the second datetime is removed the test succeeds. Is this an eventsource limitation or a bug in the analyzer? I'm on the latest analyzer package version - 2.0.1406.1
jeremy-collette and cgillum
Metadata
Metadata
Assignees
Labels
No labels