Unsupported type ActionExecutingContext in event source

Topics: Logging Application Block, Semantic Logging Application Block
Jun 5, 2013 at 4:29 PM
Hi, I am experimenting Microsoft.Practices.EnterpriseLibrary.SemanticLogging.
I had a method declared as below:
[Event(EVENT.ACTION_START, Message = "Starting action={0} user={1} route data={2}",
            Opcode = EventOpcode.Start,
            Task = Tasks.PAGE, Keywords = Keywords.PAGE,
            Level = EventLevel.Informational)]
        public void ActionStart(ActionExecutingContext filterContext, IContextReader reader)
        {
            if (!IsEnabled())
            {
                return;
            }

            string action, user, route;
            reader.Read(filterContext, out action, out user, out route);

            WriteEvent(EVENT.ACTION_START, action, user, route);
        }
And then try using the EventSourceAnalyzer class to create a unit test:
 [TestMethod]
        public void ShouldValidateMainApplicationEventSourceTest()
        {
            EventSourceAnalyzer.InspectAll(MainApplicationEventSource.Log);
        }
This unit test is throwing an exception:
Test Name:  ShouldValidateMainApplicationEventSourceTest
Test FullName:  SemanticLog.Tests.MainApplicationEventSourceTest.ShouldValidateMainApplicationEventSourceTest
Test Source:    SomePath\Test\SemanticLog.Tests\MainApplicationEventSourceTest.cs : line 12
Test Outcome:   Failed
Test Duration:  0:00:00.0381959

Result Message: 
Test method SemanticLog.Tests.MainApplicationEventSourceTest.ShouldValidateMainApplicationEventSourceTest threw exception: 
System.ArgumentException: Unsupported type ActionExecutingContext in event source.
Result StackTrace:  
at System.Diagnostics.Tracing.ManifestBuilder.GetTypeName(Type type)
   at System.Diagnostics.Tracing.ManifestBuilder.AddEventParameter(Type type, String name)
   at System.Diagnostics.Tracing.EventSource.CreateManifestAndDescriptors(Type eventSourceType, String eventSourceDllName, EventSource source)
   at System.Diagnostics.Tracing.EventSource.InsureInitialized()
   at System.Diagnostics.Tracing.EventSource.SendCommand(EventListener listener, EventCommand command, Boolean enable, EventLevel level, EventKeywords matchAnyKeyword, IDictionary`2 commandArguments)
   at System.Diagnostics.Tracing.EventListener.EnableEvents(EventSource eventSource, EventLevel level, EventKeywords matchAnyKeyword, IDictionary`2 arguments)
   at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility.EventSourceAnalyzer.CheckEnableEvents(EventSource eventSource)
   at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility.EventSourceAnalyzer.Inspect(EventSource eventSource)
   at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility.EventSourceAnalyzer.InspectAll(EventSource eventSource)
   at SemanticLog.Tests.MainApplicationEventSourceTest.ShouldValidateMainApplicationEventSourceTest() in SomePath\Test\SemanticLog.Tests\MainApplicationEventSourceTest.cs:line 13
Note that I had replaced the full path to "SomePath" in the exception detail above.

According to the Enterprise Library 6 Help file (http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=entlib&DownloadId=671120&FileTime=130139053131670000&Build=20539):
The Inspect and InspectAll methods throw an EventSourceAnalyzerException if any of the checks in the previous table fail. The exception contains details of the cause of the failure.
But the error in this case is not of type EventSourceAnalyzerException. Do I have to change the signature of my method ActionStart to use only primitive types as parameters? Do I have to have the exact same parameters as I have specified in the WriteEvent call?
Jun 5, 2013 at 4:43 PM
I found a related discussion:
https://entlib.codeplex.com/discussions/437849