Runtime: Microsoft.Diagnostics.Tracing.EventSource vs. System.Diagnostics.Tracing.EventSource

Created on 27 Aug 2019  路  6Comments  路  Source: dotnet/runtime

I'm confused by the three available sources of EventSource, and unsure which one is the correct one to use.

The Microsoft.Diagnostics.Tracing.EventSource package has not been updated since 2015. However, the Microsoft.Diagnostics.Tracing.EventSource.Redist package has newer versions and seems to be under active development. The description of the Redist package says "Application developers that need this functionality should instead reference the Microsoft.Diagnostics.Tracing.EventSource", however, that's the package that is not maintained any more. And then there is also the built in System.Diagnostics.Tracing.EventSource.

I'm using EventSource in a library that is used by several applications. Some of them are .NET Framework, others are .NET Core applications, so I'd like to develop a .NET Standard class library. Which EventSource version is the correct one for my use case and why?

area-System.Diagnostics.Tracing question

Most helpful comment

Unless you are targeting a version of .NET older than 4.5 or netstandard 1.1, you will want to use System.Diagnostics.Tracing.EventSource. The Redist package is meant for adding EventSource in for older versions of the framework and is actually the same code base as the baked in version. @brianrob is there a way we can make this more explicit in the package descriptions?

All 6 comments

cc: @tommcdon

@josalem @sywhang @noahfalk

Unless you are targeting a version of .NET older than 4.5 or netstandard 1.1, you will want to use System.Diagnostics.Tracing.EventSource. The Redist package is meant for adding EventSource in for older versions of the framework and is actually the same code base as the baked in version. @brianrob is there a way we can make this more explicit in the package descriptions?

It would be reasonable to update the package description here with more details.

Thanks for the quick response and clarification.

My pleasure! I'm going to leave this open as work item for updating the description of the packages.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamesqo picture jamesqo  路  3Comments

yahorsi picture yahorsi  路  3Comments

GitAntoinee picture GitAntoinee  路  3Comments

btecu picture btecu  路  3Comments

matty-hall picture matty-hall  路  3Comments