@@ -650,39 +650,31 @@ Copyright (c) .NET Foundation. All rights reserved.
650650 </ItemGroup >
651651 </Target >
652652
653- <Target Name =" _AddWasmDiagnosticPortsEnvironmentVariable" Condition =" '$(EnableDiagnostics)' == 'true'" >
654- <PropertyGroup >
655- <_WasmPerfInstFilter >$(WasmPerformanceInstrumentation)</_WasmPerfInstFilter >
656- <_WasmPerfInstInterval ></_WasmPerfInstInterval >
657- <_WasmPerfInstDescriptor ></_WasmPerfInstDescriptor >
658- <_WasmPerfInstInterval Condition =" $(WasmPerformanceInstrumentation.Contains(',interval='))" >$(WasmPerformanceInstrumentation.Substring($([MSBuild]::Add($(WasmPerformanceInstrumentation.IndexOf(',interval=')), 10))))</_WasmPerfInstInterval >
659- <_WasmPerfInstFilter Condition =" $(WasmPerformanceInstrumentation.Contains(',interval='))" >$(WasmPerformanceInstrumentation.Substring(0, $(WasmPerformanceInstrumentation.IndexOf(',interval='))))</_WasmPerfInstFilter >
660- <_WasmPerfInstInterval Condition =" '$(_WasmPerfInstInterval)' != '' and $(_WasmPerfInstInterval.Contains(','))" >$(_WasmPerfInstInterval.Substring(0, $(_WasmPerfInstInterval.IndexOf(','))))</_WasmPerfInstInterval >
661- <_WasmPerfInstDescriptor Condition =" '$(_WasmPerfInstFilter)' != '' and '$(UseMonoRuntime)' != 'false'" >eventpipe,callspec=$(_WasmPerfInstFilter)</_WasmPerfInstDescriptor >
662- <_WasmPerfInstFilter Condition =" '$(_WasmPerfInstFilter)' == 'all' and '$(UseMonoRuntime)' == 'false'" >*</_WasmPerfInstFilter >
663- <_WasmPerfInstDescriptor Condition =" '$(_WasmPerfInstFilter)' != '' and '$(UseMonoRuntime)' == 'false'" >$(_WasmPerfInstFilter)</_WasmPerfInstDescriptor >
664- </PropertyGroup >
653+ <Target Name =" _ValidateWasmPerformanceInstrumentation" BeforeTargets =" PrepareForBuild" >
654+ <Error Condition =" $(WasmPerformanceInstrumentation.Contains(',interval='))"
655+ Text =" The interval option is no longer supported in WasmPerformanceInstrumentation. Set DOTNET_EventPipeThreadSamplingRate using a WasmEnvironmentVariable item instead." />
656+ </Target >
657+
658+ <Target Name =" _AddWasmDiagnosticPortsEnvironmentVariable"
659+ Condition =" '$(EnableDiagnostics)' == 'true'"
660+ DependsOnTargets =" _ValidateWasmPerformanceInstrumentation" >
665661 <ItemGroup >
666662 <WasmEnvironmentVariable Include =" DOTNET_DiagnosticPorts" Value =" $(DiagnosticPorts)" Condition =" '$(DiagnosticPorts)' != '' and '$(EnableDiagnostics)' == 'true'" />
667663 </ItemGroup >
668664 </Target >
669665
670- <!-- CoreCLR: transform WasmPerformanceInstrumentation into separate env vars for MethodSet filter + interval .
666+ <!-- CoreCLR: transform WasmPerformanceInstrumentation into a MethodSet filter.
671667 Mono handles this in WasmApp.Common.targets with "eventpipe,callspec=" prefix, so skip for Mono.
672668 UseMonoRuntime=false indicates CoreCLR; when true or unset, Mono workload targets handle it. -->
673669 <Target Name =" _AddWasmPerformanceInstrumentationEnvironmentVariables"
674- Condition =" '$(UseMonoRuntime)' == 'false' and '$(WasmPerformanceInstrumentation)' != ''" >
670+ Condition =" '$(UseMonoRuntime)' == 'false' and '$(WasmPerformanceInstrumentation)' != ''"
671+ DependsOnTargets =" _ValidateWasmPerformanceInstrumentation" >
675672 <PropertyGroup >
676673 <_WasmPerfInstFilter >$(WasmPerformanceInstrumentation)</_WasmPerfInstFilter >
677- <_WasmPerfInstInterval ></_WasmPerfInstInterval >
678- <_WasmPerfInstInterval Condition =" $(WasmPerformanceInstrumentation.Contains(',interval='))" >$(WasmPerformanceInstrumentation.Substring($([MSBuild]::Add($(WasmPerformanceInstrumentation.IndexOf(',interval=')), 10))))</_WasmPerfInstInterval >
679- <_WasmPerfInstFilter Condition =" $(WasmPerformanceInstrumentation.Contains(',interval='))" >$(WasmPerformanceInstrumentation.Substring(0, $(WasmPerformanceInstrumentation.IndexOf(',interval='))))</_WasmPerfInstFilter >
680- <_WasmPerfInstInterval Condition =" '$(_WasmPerfInstInterval)' != '' and $(_WasmPerfInstInterval.Contains(','))" >$(_WasmPerfInstInterval.Substring(0, $(_WasmPerfInstInterval.IndexOf(','))))</_WasmPerfInstInterval >
681674 <_WasmPerfInstFilter Condition =" '$(_WasmPerfInstFilter)' == 'all'" >*</_WasmPerfInstFilter >
682675 </PropertyGroup >
683676 <ItemGroup >
684677 <WasmEnvironmentVariable Include =" DOTNET_WasmPerformanceInstrumentation" Value =" $(_WasmPerfInstFilter)" />
685- <WasmEnvironmentVariable Condition =" '$(_WasmPerfInstInterval)' != ''" Include =" DOTNET_EventPipeThreadSamplingRate" Value =" $(_WasmPerfInstInterval)" />
686678 </ItemGroup >
687679 </Target >
688680
0 commit comments