Skip to content

Commit 6677e67

Browse files
committed
[net10.0] [dotnet] Disable Metrics support when Optimize=true.
Disable Metrics support when `Optimize=true` (instead of when `Release=true`) to avoid depending on a configuration. This makes our logic identical to Android's logic: dotnet/android#9928.
1 parent ddc7ab4 commit 6677e67

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/configuration-properties.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ There are a number of properties that are contingent upon the configuration sett
99
|--------------------------------------------------------- |----------------------------------- |--------------------------------------- |
1010
| DebuggerSupport | false | |
1111
| EnableAssemblyILStripping | true | |
12-
| MetricsSupport | false | |
1312
| RuntimeIdentifiers | maccatalyst-x64;maccatalyst-arm64 | TargetFramework == netx.x-maccatalyst |
1413
| RuntimeIdentifiers | osx-x64;osx-arm64 | TargetFramework == netx.x-macos |
1514
| UseSystemResourceKeys | true | |
@@ -26,3 +25,12 @@ There are a number of properties that are contingent upon the configuration sett
2625
| RuntimeIdentifiers | maccatalyst-x64 | TargetFramework == netx.x-maccatalyst |
2726
| RuntimeIdentifiers | osx-x64 | TargetFramework == netx.x-macos |
2827
| UseSystemResourceKeys | false | |
28+
29+
### Optimize=true
30+
31+
These are options that are set when the `Optimize` property is `true` (which happens by default if `Configuration=Release`).
32+
33+
| **Property** | **Value** |
34+
|--------------------------------|------------|
35+
| MetricsSupport | false |
36+

dotnet/targets/Xamarin.Shared.Sdk.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<EnableUnsafeBinaryFormatterSerialization Condition="'$(EnableUnsafeBinaryFormatterSerialization)' == ''">false</EnableUnsafeBinaryFormatterSerialization>
115115
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
116116
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
117-
<MetricsSupport Condition="'$(MetricsSupport)' == '' And '$(Configuration)' == 'Release'">false</MetricsSupport>
117+
<MetricsSupport Condition="'$(MetricsSupport)' == '' And '$(Optimize)' == 'true'">false</MetricsSupport>
118118
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
119119
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
120120
<!-- Enable HybridGlobalization by default-->

0 commit comments

Comments
 (0)