Fix and Enable Most ETW EventSource Tests (dotnet/corefx#27107)
authorBrian Robbins <brianrob@microsoft.com>
Wed, 14 Feb 2018 04:25:55 +0000 (20:25 -0800)
committerGitHub <noreply@github.com>
Wed, 14 Feb 2018 04:25:55 +0000 (20:25 -0800)
Commit migrated from https://github.com/dotnet/corefx/commit/ad52ae103416ea67e30abf21c19d5d0c0cd01b11

15 files changed:
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/FuzzyTests.cs
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/EventTestHarness.cs
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/Listeners.cs
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/LoudListener.cs
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestShutdown.cs
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.cs
src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs
src/libraries/System.Diagnostics.Tracing/tests/Configurations.props
src/libraries/System.Diagnostics.Tracing/tests/CustomEventSources/EventSourceTest.cs
src/libraries/System.Diagnostics.Tracing/tests/System.Diagnostics.Tracing.Tests.csproj
src/libraries/dependencies.props

index bb586b4..46f2bcc 100644 (file)
@@ -13,7 +13,7 @@ using Microsoft.Diagnostics.Tracing;
 using System.Diagnostics.Tracing;
 #endif
 using Xunit;
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
 using Microsoft.Diagnostics.Tracing.Session;
 #endif
 
@@ -2747,8 +2747,7 @@ namespace BasicEventSourceTests
                     Assert.Equal("FWKFKXHDFY", evt.EventName);
                 }));
 
-                // Run tests for ETW
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
                 using (var listener = new EtwListener())
                 {
                     EventTestHarness.RunTests(tests, listener, logger);
index fc1b1de..70af972 100644 (file)
@@ -141,7 +141,7 @@ namespace BasicEventSourceTests
             }
             catch (Exception e)
             {
-                if (e is EventSourceException)
+                if ((e is EventSourceException) && (e.InnerException != null))
                     e = e.InnerException;
                 LogWriteLine("Exception thrown: {0}", e.Message);
 
index e56fc8b..f1433e0 100644 (file)
@@ -2,8 +2,10 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
+using Microsoft.Diagnostics.Tracing;
 using Microsoft.Diagnostics.Tracing.Session;
+using Microsoft.Diagnostics.Tracing.Etlx;
 #endif
 using System;
 using System.Collections.Generic;
@@ -136,14 +138,14 @@ namespace BasicEventSourceTests
             {
                 if (i != 0)
                     sb.Append(',');
-                sb.Append(PayloadString(i, null));
+                sb.Append(PayloadString(i, PayloadNames[i]));
             }
             sb.Append(')');
             return sb.ToString();
         }
     }
 
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
     /**************************************************************************/
     /* Concrete implementation of the Listener abstraction */
 
@@ -165,7 +167,7 @@ namespace BasicEventSourceTests
             // Today you have to be Admin to turn on ETW events (anyone can write ETW events).   
             if (TraceEventSession.IsElevated() != true)
             {
-                throw new ApplicationException("Need to be elevated to run. ");
+                throw new Exception("Need to be elevated to run. ");
             }
 
             if (dataFileName == null)
@@ -214,6 +216,12 @@ namespace BasicEventSourceTests
 
         public override void Dispose()
         {
+            if(_disposed)
+            {
+                return;
+            }
+
+            _disposed = true;
             _session.Flush();
             Thread.Sleep(1010);      // Let it drain.
             _session.Dispose();     // This also will kill the real time thread 
@@ -225,7 +233,6 @@ namespace BasicEventSourceTests
                     Debug.WriteLine("Processing data file " + Path.GetFullPath(_dataFileName));
 
                     // Parse all the events as best we can, and also send unhandled events there as well.  
-                    traceEventSource.Registered.All += OnEventHelper;
                     traceEventSource.Dynamic.All += OnEventHelper;
                     traceEventSource.UnhandledEvents += OnEventHelper;
                     // Process all the events in the file.  
@@ -238,12 +245,23 @@ namespace BasicEventSourceTests
     #region private
         private void OnEventHelper(TraceEvent data)
         {
+            // Ignore EventTrace events.
+            if (data.ProviderGuid == EventTraceProviderID)
+                return;
+
+            // Ignore kernel events.
+            if (data.ProviderGuid == KernelProviderID)
+                return;
+
             // Ignore manifest events. 
             if ((int)data.ID == 0xFFFE)
                 return;
             this.OnEvent(new EtwEvent(data));
         }
 
+        private static readonly Guid EventTraceProviderID = new Guid("9e814aad-3204-11d2-9a82-006008a86939");
+        private static readonly Guid KernelProviderID = new Guid("9e814aad-3204-11d2-9a82-006008a86939");
+
         /// <summary>
         /// EtwEvent implements the 'Event' abstraction for ETW events (it has a TraceEvent in it) 
         /// </summary>
@@ -273,6 +291,7 @@ namespace BasicEventSourceTests
     #endregion
         }
 
+        private bool _disposed;
         private string _dataFileName;
         private volatile TraceEventSession _session;
     #endregion
@@ -334,6 +353,12 @@ namespace BasicEventSourceTests
 
         public override void Dispose()
         {
+            if (_disposed)
+            {
+                return;
+            }
+
+            _disposed = true;
             EventTestHarness.LogWriteLine("Disposing Listener");
             _listener.Dispose();
         }
@@ -438,5 +463,7 @@ namespace BasicEventSourceTests
                 return _data.Payload[propertyIndex];
             }
         }
+
+        private bool _disposed;
     }
 }
index 7f26da5..88801bc 100644 (file)
@@ -30,5 +30,10 @@ namespace BasicEventSourceTests
             Debug.Write(string.Format(" (activity {0}{1}) ", eventData.ActivityId, eventData.RelatedActivityId != null ? "->" + eventData.RelatedActivityId : ""));
             Debug.WriteLine(string.Format(" ({0}).", eventData.Payload != null ? string.Join(", ", eventData.Payload) : ""));
         }
+
+        public static EventWrittenEventArgs LastEvent
+        {
+            get { return t_lastEvent; }
+        }
     }
 }
index 2fccb97..f08b2e6 100644 (file)
@@ -8,7 +8,7 @@ using Microsoft.Diagnostics.Tracing;
 #else
 using System.Diagnostics.Tracing;
 #endif
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue https://github.com/dotnet/corefx/issues/4864 
+#if USE_ETW
 using Microsoft.Diagnostics.Tracing.Session;
 #endif
 using Xunit;
@@ -63,6 +63,7 @@ namespace BasicEventSourceTests
 
 #if USE_ETW
         [Fact]
+        [ActiveIssue("https://github.com/dotnet/corefx/issues/27106")]
         public void Test_Write_Metric_ETW()
         {
 
index b88408d..d02791f 100644 (file)
@@ -4,6 +4,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -13,7 +14,8 @@ using Microsoft.Diagnostics.Tracing;
 using System.Diagnostics.Tracing;
 #endif
 using Xunit;
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
+using Microsoft.Diagnostics.Tracing;
 using Microsoft.Diagnostics.Tracing.Session;
 #endif
 using System.IO;
@@ -23,7 +25,9 @@ namespace BasicEventSourceTests
 {
     public class TestShutdown
     {
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+
+        // TODO: Depends on desktop APIs (AppDomainSetup and Evidence).
+#if USE_ETW && FALSE
         /// <summary>
         /// Test for manifest event being logged during AD/Process shutdown during EventSource Dispose(bool) method.
         /// </summary>
@@ -89,7 +93,6 @@ namespace BasicEventSourceTests
                 };
 
                 // Parse all the events as best we can, and also send unhandled events there as well.  
-                traceEventSource.Registered.All += onEvent;
                 traceEventSource.Dynamic.All += onEvent;
                 traceEventSource.UnhandledEvent += onEvent;
                 traceEventSource.Process();
index 922168d..a23f456 100644 (file)
@@ -104,9 +104,9 @@ namespace BasicEventSourceTests
                 () => EventSource.GenerateManifest(typeof(Sdt.TooManyChannelsEventSource), string.Empty));
 #endif
 
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
-            e = AssertExtensions.Throws<ArgumentException>(GetResourceString("EventSource_EventWithAdminChannelMustHaveMessage", "WriteInteger", "Admin"),
-                () => EventSource.GenerateManifest(typeof(Sdt.EventWithAdminChannelNoMessageEventSource), string.Empty, strictOptions));
+#if USE_ETW
+            e = AssertExtensions.Throws<ArgumentException>(null, () => EventSource.GenerateManifest(typeof(Sdt.EventWithAdminChannelNoMessageEventSource), string.Empty, strictOptions));
+            AsserExceptionStringsEqual(() => GetResourceString("EventSource_EventWithAdminChannelMustHaveMessage", "WriteInteger", "Admin"), e);
 #endif // USE_ETW
 
             e = AssertExtensions.Throws<ArgumentException>(null, () => EventSource.GenerateManifest(typeof(Sdt.ReservedOpcodeEventSource), string.Empty, strictOptions));
index 046b5e4..d260526 100644 (file)
@@ -74,7 +74,7 @@ namespace BasicEventSourceTests
         [SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Depends on inspecting IL at runtime.")]
         public void Test_BadEventSource_MismatchedIds()
         {
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
             // We expect only one session to be on when running the test but if a ETW session was left
             // hanging, it will confuse the EventListener tests.   
             EtwListener.EnsureStopped();
@@ -86,7 +86,7 @@ namespace BasicEventSourceTests
                     var listenerGenerators = new Func<Listener>[]
                     {
                         () => new EventListenerListener(),
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
                         () => new EtwListener()
 #endif // USE_ETW
                     };
index 5743bbe..ccd0305 100644 (file)
@@ -13,7 +13,7 @@ using Microsoft.Diagnostics.Tracing;
 using System.Diagnostics.Tracing;
 #endif
 using Xunit;
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
 using Microsoft.Diagnostics.Tracing.Session;
 #endif
 using System.Diagnostics;
@@ -63,7 +63,7 @@ namespace BasicEventSourceTests
             Test_Write_T(new EventListenerListener(true));
         }
 
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
         /// <summary>
         /// Tests the EventSource.Write[T] method (can only use the self-describing mechanism).  
         /// Tests the ETW code path
@@ -414,18 +414,19 @@ namespace BasicEventSourceTests
         /// </summary>
         [Fact]
         [ActiveIssue("dotnet/corefx #18806", TargetFrameworkMonikers.NetFramework)]
+        [ActiveIssue("https://github.com/dotnet/corefx/issues/27106")]
         public void Test_Write_T_In_Manifest_Serialization()
         {
             using (var eventListener = new EventListenerListener())
             {
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
                 using (var etwListener = new EtwListener())
 #endif
                 {
                     var listenerGenerators = new Func<Listener>[]
                     {
                         () => eventListener,
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
                         () => etwListener
 #endif // USE_ETW
                     };
index 080f6d7..f03e1a4 100644 (file)
@@ -24,7 +24,7 @@ namespace BasicEventSourceTests
 {
     public class TestsWriteEvent
     {
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
         /// <summary>
         /// Tests WriteEvent using the manifest based mechanism.   
         /// Tests the ETW path. 
@@ -62,7 +62,7 @@ namespace BasicEventSourceTests
         {
             Test_WriteEvent(new EventListenerListener(true), false);
         }
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
         /// <summary>
         /// Tests WriteEvent using the self-describing mechanism.   
         /// Tests both the ETW and TraceListener paths. 
@@ -156,7 +156,7 @@ namespace BasicEventSourceTests
                         Assert.Equal(evt.PayloadValue(0, "arg1"), "one");
                         Assert.Equal(evt.PayloadValue(1, "arg2"), "two");
                     }));
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
                 /*************************************************************************/
                 tests.Add(new SubTest("Write/Basic/EventWithManyTypeArgs",
                     delegate ()
@@ -200,7 +200,7 @@ namespace BasicEventSourceTests
                         Assert.Equal("s0", (string)evt.PayloadValue(0, "s0"));
                         Assert.Equal("s8", (string)evt.PayloadValue(8, "s8"));
                     }));
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
                 /*************************************************************************/
                 tests.Add(new SubTest("Write/Activity/EventWithXferWeirdArgs",
                     delegate ()
@@ -221,7 +221,7 @@ namespace BasicEventSourceTests
 
                         Assert.Equal("128", evt.PayloadValue(0, "iptr").ToString());
                         Assert.Equal(true, (bool)evt.PayloadValue(1, "b"));
-                        Assert.Equal((long)SdtEventSources.MyLongEnum.LongVal1, (long)evt.PayloadValue(2, "le"));
+                        Assert.Equal((long)SdtEventSources.MyLongEnum.LongVal1, ((IConvertible)evt.PayloadValue(2, "le")).ToInt64(null));
                     }));
 #endif // USE_ETW
                 /*************************************************************************/
@@ -239,7 +239,7 @@ namespace BasicEventSourceTests
                         Assert.Equal(logger.Name, evt.ProviderName);
                         Assert.Equal("EventEnum", evt.EventName);
 
-                        Assert.Equal(1, (int)evt.PayloadValue(0, "x"));
+                        Assert.Equal(1, ((IConvertible)evt.PayloadValue(0, "x")).ToInt32(null));
                         if (evt.IsEtw && !useSelfDescribingEvents)
                             Assert.Equal("Blue", evt.PayloadString(0, "x"));
                     }));
@@ -254,7 +254,7 @@ namespace BasicEventSourceTests
                        Assert.Equal(logger.Name, evt.ProviderName);
                        Assert.Equal("EventEnum1", evt.EventName);
 
-                       Assert.Equal(1, (int)evt.PayloadValue(0, "x"));
+                       Assert.Equal(1, ((IConvertible)evt.PayloadValue(0, "x")).ToInt32(null));
                        if (evt.IsEtw && !useSelfDescribingEvents)
                            Assert.Equal("Blue", evt.PayloadString(0, "x"));
                    }));
@@ -363,7 +363,12 @@ namespace BasicEventSourceTests
                         Assert.Equal("", evt.PayloadValue(2, null));
                     }));
 
-                if (useSelfDescribingEvents)
+                // Self-describing ETW does not support NULL arguments.
+                if (useSelfDescribingEvents
+#if USE_ETW
+                    && !(listener is EtwListener)
+#endif // USE_ETW
+                   )
                 {
                     tests.Add(new SubTest("WriteEvent/Basic/EventVarArgsWithString",
                         delegate () { logger.EventVarArgsWithString(1, 2, 12, null); },
@@ -430,7 +435,7 @@ namespace BasicEventSourceTests
             }
         }
 
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
         /// <summary>
         /// Tests sending complex data (class, arrays etc) from WriteEvent 
         /// Tests the EventListener case
@@ -519,7 +524,7 @@ namespace BasicEventSourceTests
             Test_WriteEvent_ByteArray(false, new EventListenerListener(true));
         }
 
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
         /// <summary>
         /// Tests sending complex data (class, arrays etc) from WriteEvent 
         /// Uses Manifest format
@@ -549,7 +554,7 @@ namespace BasicEventSourceTests
             }
         }
 
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
         /// <summary>
         /// Tests sending complex data (class, arrays etc) from WriteEvent 
         /// Uses Self-Describing format
@@ -647,6 +652,8 @@ namespace BasicEventSourceTests
                         Assert.Equal(1000, (long)evt.PayloadValue(1, "lng"));
                     }));
 
+                /* TODO: NULL byte array does not seem to be supported.
+                 * An EventSourceMessage event is written for this case.
                 tests.Add(new SubTest("Write/Array/EventWithNullByteArray",
                     delegate ()
                     {
@@ -664,6 +671,7 @@ namespace BasicEventSourceTests
                             Assert.Equal(0, (int)evt.PayloadValue(1, "n"));
                         }
                     }));
+                */
 
                 tests.Add(new SubTest("Write/Array/EventWithEmptyByteArray",
                     delegate ()
index 4cbc1c2..bdb11d9 100644 (file)
@@ -150,7 +150,7 @@ namespace BasicEventSourceTests
                     Assert.Equal(MyFlags.Flag1, (MyFlags)LoudListener.t_lastEvent.Payload[0]);
                     #endregion
 
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
                     #region Validate DateTime
                     DateTime now = DateTime.Now;
                     log.EventDateTime(now);
@@ -178,7 +178,7 @@ namespace BasicEventSourceTests
                     EventSource.SendCommand(log, EventCommand.SendManifest, options);
 
                     Guid guid = Guid.NewGuid();
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
                     log.EventWithManyTypeArgs("Hello", 0, 0, 0, 'a', 0, 0, 0, 0, (float)10.0, (double)11.0, guid);
                     Assert.Equal(25, LoudListener.LastEvent.EventId);
                     Assert.Equal(12, LoudListener.LastEvent.Payload.Count);
@@ -206,7 +206,7 @@ namespace BasicEventSourceTests
                     Assert.Equal(9, LoudListener.t_lastEvent.Payload.Count);
                     Assert.Equal("s0", (string)LoudListener.t_lastEvent.Payload[0]);
                     Assert.Equal("s8", (string)LoudListener.t_lastEvent.Payload[8]);
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
                     log.EventWithWeirdArgs(IntPtr.Zero, true, MyLongEnum.LongVal1 /*, 9999999999999999999999999999m*/);
                     Assert.Equal(30, LoudListener.LastEvent.EventId);
                     Assert.Equal(3 /*4*/, LoudListener.LastEvent.Payload.Count);
@@ -255,14 +255,14 @@ namespace BasicEventSourceTests
             TestUtilities.CheckNoEventSourcesRunning("Stop");
         }
 
-#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
+#if USE_ETW
         [Fact]
         public void Test_WriteEvent_TransferEvents()
         {
             TestUtilities.CheckNoEventSourcesRunning("Start");
             using (var log = new EventSourceTest())
             {
-                using (var el = new LoudListener())
+                using (var el = new LoudListener(log))
                 {
                     Guid actid = Guid.NewGuid();
                     log.LogTaskScheduled(actid, "Hello from a test");
index 8b803e0..1040c9b 100644 (file)
@@ -2,8 +2,8 @@
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <BuildConfigurations>
-      netcoreapp;
-      netstandard;
+      netcoreapp-Windows_NT;
+      netcoreapp-Unix;
     </BuildConfigurations>
   </PropertyGroup>
 </Project>
\ No newline at end of file
index 6261ab7..725a8d8 100644 (file)
@@ -137,13 +137,12 @@ namespace SdtEventSources
         public void EventDateTime(DateTime dt) { WriteEvent(24, dt); }
 
         [Event(25, Keywords = Keywords.HasNoArgs, Level = EventLevel.Informational)]
-        public void EventWithManyTypeArgs(string msg, long l, uint ui, UInt64 ui64,
+        public void EventWithManyTypeArgs(string msg, long l, uint ui, UInt64 ui64, char c,
                                           byte b, sbyte sb, short sh, ushort ush,
                                           float f, double d, Guid guid)
         {
             if (IsEnabled(EventLevel.Informational, Keywords.HasNoArgs))
-                // 4.5 EventSource does not support "Char" type
-                WriteEvent(25, msg, l, ui, ui64, b, sb, sh, ush, f, d, guid);
+                WriteEvent(25, msg, l, ui, ui64, c, b, sb, sh, ush, f, d, guid);
         }
 
         [Event(26)]
index 5974d34..a91cb64 100644 (file)
@@ -5,12 +5,13 @@
     <ProjectGuid>{7E0E1B11-FF70-461E-99F7-C0AF252C0C60}</ProjectGuid>
     <DefineConstants Condition="'$(TargetGroup)' == 'netcoreapp'">$(DefineConstants);FEATURE_ETLEVENTS</DefineConstants>
     <DefineConstants Condition="'$(TargetGroup)' == 'netcoreapp'">$(DefineConstants);FEATURE_EVENTCOUNTER_DISPOSE</DefineConstants>
+    <DefineConstants Condition="'$(TargetGroup)' == 'netcoreapp' And '$(TargetsWindows)' == 'true'">$(DefineConstants);USE_ETW</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
   <ItemGroup>
     <Compile Include="BasicEventSourceTest\Harness\EventTestHarness.cs" />
     <Compile Include="BasicEventSourceTest\FuzzyTests.cs" />
@@ -39,6 +40,9 @@
     <Compile Include="CustomEventSources\UseInterfaceEventSource.cs" />
   </ItemGroup>
   <ItemGroup>
+      <ReferenceFromRuntime Include="Microsoft.Diagnostics.Tracing.TraceEvent" />
+  </ItemGroup>
+  <ItemGroup>
     <EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
   </ItemGroup>
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
index 6c334c7..c981df6 100644 (file)
@@ -47,7 +47,7 @@
 
     <AppXRunnerVersion>1.0.3-prerelease-00921-01</AppXRunnerVersion>
     <XunitPerfAnalysisPackageVersion>1.0.0-beta-build0015</XunitPerfAnalysisPackageVersion>
-    <TraceEventPackageVersion>1.0.3-alpha-experimental</TraceEventPackageVersion>
+    <TraceEventPackageVersion>2.0.4</TraceEventPackageVersion>
     <XunitNetcoreExtensionsVersion>2.1.0-preview2-02513-01</XunitNetcoreExtensionsVersion>
   </PropertyGroup>