Is it possible to get SLAB working with Microsoft.Diagnostics.Tracing.EventSource?

377 views Asked by At

The official release notes say:

Improved compatibility with the EventSource nuget package

  • SLAB's source must be updated and rebuilt to work with the EventSource nuget package (which supports channels, but does not support sampling). The process is now fairly painless.
    • Added references to the EventSource nuget package to all projects
    • Changed System.Diagnostics.Tracing to Microsoft.Diagnostics.Tracing in all source files
    • Defined the EVENT_SOURCE_PACKAGE constant in the unit test project (to disable tests that cannot possibly work with the nuget version).

This is a bit cryptic. Something seems backwards because I can't see any references at all to Microsoft.Diagnostics.Tracing in the Nuget download.

Or are the sub-bullets things that you have to do to get it to build (so it should say, Add, Change, Define instead of Added, Changed, Defined)?

Hm, well those instructions (if they are instructions) are not sufficient:

  • There are three places where Microsoft.Diagnostics.Tracing is already referenced, so that gives duplicate warnings
  • There are multiple places where ambiguities appear between Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Configuration.EventSourceSettings (which is a class) and Microsoft.Diagnostics.Tracing.EventSourceSettings (which is an enum).
3

There are 3 answers

0
Randy Levy On

@Benjol's detective work is correct.

Many users wanted to be able to use EventSource channels (which is included in the EventSource NuGet package) with SLAB so compatibility was improved to make compiling against the EventSource package at the time of release quite painless.

However, SLAB has not been updated recently but the EventSource Package continues to add/modify features. Some of these could be breaking changes with the current SLAB implementation. Since compatibility with subsequent releases of EventSource might not have been tested (I'm not sure what the team has done on this) there could be potential issues.

2
Benjol On

A bit of detective work and common sense:

The last release date of SLAB is 25 July 2014, there have been a whole load of versions of Microsoft.Diagnostics.Tracing.EventSource, including one which presumably innocently introduced EventSourceSettings.

If I install and reference version 1.0.26, the instructions work.

Now just have to find out what things from version 1.1.28 are missing, and whether I miss them.

0
Paula On

So, I just made SLAB work with the NuGet EventSource packages by following the directions above with SLAB 1.1.28 and the latest NuGet EventSource from the Microsoft.Diagnostics.Tracing.EventSource namespace.

Essentially, you need to fix up the ambiguous references between Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Configuration.EventSourceSettings and Microsoft.Diagnostics.Tracing.EventSourceSettings, just as it says above.

You want the Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Configuration.EventSourceSettings reference.

It works, produces flat file logs and writes to the Event Viewer, and when used in conjunction with a controller like PerfView, produces ETL files for detailed analysis.

Next, I'll be testing the out-of-process case.