Closed stephentoub closed 4 years ago
The file-based configuration invocation of EventPipe is meant to silently fail if something goes wrong--as you mentioned, this logic is wrapped in a try/catch/finally block. Since the file-based configuration invocation of Eventpipe is going to be removed entirely in an upcoming change, I'm going to leave this as-is for now.
EventPipeController's ctor accesses AppContext.BaseDirectory and passes the result to Path.Combine, which will throw an ArgumentNullException if BaseDirectory returns null. BaseDirectory returns the result of GetBaseDirectoryCore, which calls Assembly.GetEntryAssembly()?.Location. GetEntryAssembly may return null, in which case GetBaseDirectoryCore will return null, in which case Path.Combine will throw and the EventPipeController ctor will throw. This will be eaten in the Initialize method by a catch-all block, but it seems like it'd be better not to throw in the first place.