Add telemetry data points for .NET Core 2.0

This commit is contained in:
William Li 2017-06-05 20:51:58 -07:00 committed by William Lee
parent 676fe41aca
commit 081f208942
29 changed files with 1324 additions and 77 deletions

View file

@ -5,6 +5,7 @@ using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.DotNet.Cli;
using Microsoft.DotNet.Cli.Telemetry;
using Microsoft.DotNet.Configurer;
namespace Microsoft.DotNet.Tools.MSBuild
@ -39,15 +40,13 @@ namespace Microsoft.DotNet.Tools.MSBuild
{
if (_telemetry != null && _telemetry.Enabled)
{
IEventSource2 eventSource2 = eventSource as IEventSource2;
if (eventSource2 != null)
if (eventSource is IEventSource2 eventSource2)
{
eventSource2.TelemetryLogged += OnTelemetryLogged;
}
}
}
catch(Exception)
catch (Exception)
{
// Exceptions during telemetry shouldn't cause anything else to fail
}