Raghu
Raghu

Reputation: 3069

How to get ETW manifest file related to service fabric service's EventSource?

When you create a stateless reliable service project with visual studio, you get a custom event source that sub-classes EventSource class from .net framework. Since the EventSource is same as ETW's event provider, there has to be a unique GUID associated with it (to distinguish from other ETW providers). In addition, ETW requires the manifest file for tracing to work properly. The EventSource is probably hiding all this information from the developer. Is there a way to view ETW's provider information (that came out of my custom EventSource in my service) along with ETW manifest file?

Upvotes: 2

Views: 881

Answers (2)

Arnab
Arnab

Reputation: 605

You can simply install the following nuGet package in the project which has custom event source that sub-classes EventSource class

Microsoft.Diagnostics.Tracing.EventRegister

Upon building the project you will get the manifest and dll file in the bin directory.

Upvotes: 0

Raghu
Raghu

Reputation: 3069

This turned out to be extremely simple. The EventSource class has following static method:

public static string GenerateManifest(
   Type eventSourceType,
   string assemblyPathToIncludeInManifest
)

When you debug your service fabric service, you can do following:

System.Diagnostics.Debug.WriteLine(System.Diagnostics.Tracing.EventSource.GenerateManifest(typeof(ServiceEventSource), "C:\temp"))

It should give you nicely formatted manifest xml.

Upvotes: 3

Related Questions