This project is read-only.

why internal method signatures

Topics: Using
Jan 23, 2015 at 4:25 PM
Does anyone know why all the examples are using internal method signatures and if you use EventSourceAnalyzer.InspectAll you must have at least 1 internal method. It does seem to evaluate public methods, so that is good. What am I missing?
Jan 24, 2015 at 12:49 AM
Hi Nick,

I'm able to do the following with all public methods. Is this not working for you?
namespace ESATest
{
    using System;
    using System.Diagnostics.Tracing;

    using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility;

    internal class Program
    {
        private static void Main(string[] args)
        {
            EventSourceAnalyzer.InspectAll(MyTestEventSource.Log);

            Console.WriteLine("Inspection complete");
            Console.ReadKey();
        }
    }

    public class MyTestEventSource : EventSource
    {
        public static MyTestEventSource Log = new MyTestEventSource();

        public void Startup()
        {
            WriteEvent(1);
        }

        public void OpenFileStart(string fileName)
        {
            WriteEvent(2, fileName);
        }

        public void OpenFileStop()
        {
            WriteEvent(3);
        }
    }
}
Jan 27, 2015 at 1:39 PM
I just realized that the Analyzer behavior I was seeing was also a symptom of using an interface contract. The following was causing all the problems and this is very disappointing for our infrastructure. An interface really should not break the Analyzer or Out of process but it does.



public interface IMyTestEventSource
{
void Startup();
void OpenFileStart(string fileName);
void OpenFileStop();
}

public class MyTestEventSource : EventSource, IMyTestEventSource



Jan 27, 2015 at 5:22 PM
Could you send a pull request with a broken unit test? (You don't need to provide a fix.)
We'll be evaluating design changes later this month and this should be on the list.
You will need to sign a CLA, but the process is pretty painless now:
https://cla.azure.com
Jan 29, 2015 at 9:09 PM
Edited Jan 29, 2015 at 9:14 PM
The issue looks like it is in EventSource.GenerateManifest
system\diagnostics\eventing\eventproviderbase.cs

methods are excluded based on IsVirtual being true and a method that implements an interface returns IsVirtual : true. This seems a little ambiguous in terms of type information.