Skip to content

Commit

Permalink
Fix the buld to enable FEATURE_TRACING.
Browse files Browse the repository at this point in the history
Respond to PR feedback
  • Loading branch information
eerhardt committed Feb 25, 2021
1 parent e803a1b commit e35cab6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ internal void DataflowBlockCompleted(IDataflowBlock block)
Debug.Assert(block != null, "Block needed for the ETW event.");
if (IsEnabled(EventLevel.Informational, ALL_KEYWORDS))
{
Task completionTask = Common.GetPotentiallyNotSupportedCompletionTask(block);
Task? completionTask = Common.GetPotentiallyNotSupportedCompletionTask(block);
bool blockIsCompleted = completionTask != null && completionTask.IsCompleted;
Debug.Assert(blockIsCompleted, "Block must be completed for this event to be valid.");
if (blockIsCompleted)
{
var reason = (BlockCompletionReason)completionTask.Status;
var reason = (BlockCompletionReason)completionTask!.Status;
string exceptionData = string.Empty;

if (completionTask.IsFaulted)
{
try { exceptionData = string.Join(Environment.NewLine, completionTask.Exception.InnerExceptions.Select(e => e.ToString())); }
try { exceptionData = string.Join(Environment.NewLine, completionTask.Exception!.InnerExceptions.Select(e => e.ToString())); }
catch { }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<DefineConstants Condition="'$(TargetFramework)' == 'netstandard1.1' or '$(TargetFramework)' == 'netstandard2.0' or $(TargetFramework.StartsWith('net4'))">$(DefineConstants);FEATURE_TRACING</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' != 'netstandard1.0'">$(DefineConstants);FEATURE_TRACING</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'netstandard1.0'">$(DefineConstants);USE_INTERNAL_CONCURRENT_COLLECTIONS</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'netstandard1.0' or '$(TargetFramework)' == 'netstandard1.1'">$(DefineConstants);USE_INTERNAL_THREADING</DefineConstants>
<PackageTargetFramework Condition="'$(TargetFramework)' == 'netstandard1.1'">netstandard1.1;portable-net45+win8+wpa81</PackageTargetFramework>
Expand Down Expand Up @@ -64,13 +64,14 @@
<ItemGroup Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp'">
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Concurrent" />
<Reference Include="System.Diagnostics.Tracing" />
<Reference Include="System.Linq" />
<Reference Include="System.Runtime" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Thread" />
<Reference Include="System.Threading.ThreadPool" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.0' or '$(TargetFramework)' == 'netstandard1.1' or $(TargetFramework.StartsWith('net4'))">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.0' or '$(TargetFramework)' == 'netstandard1.1' or '$(TargetFramework)' == 'net461'">
<PackageReference Include="System.Diagnostics.Contracts" Version="$(SystemDiagnosticsContractsVersion)" />
<PackageReference Include="System.Dynamic.Runtime" Version="$(SystemDynamicRuntimeVersion)" />
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="$(SystemRuntimeSerializationPrimitivesVersion)" />
Expand Down

0 comments on commit e35cab6

Please sign in to comment.