Skip to content

Commit 730316d

Browse files
authored
Add MetadataUpdaterSupport property (#18670)
1 parent 94a168d commit 730316d

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

src/Assets/TestProjects/KitchenSink/TestApp/TestApp.csproj

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,33 @@
66
<EnableDefaultItems>false</EnableDefaultItems>
77
</PropertyGroup>
88

9-
<!-- Host configuration properties -->
9+
<!-- Host configuration properties
10+
Keep this list in the same order as the configProperties in GivenThatWeWantToPublishAProjectWithAllFeatures. -->
1011
<PropertyGroup>
12+
<EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization>false</EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization>
13+
<DebuggerSupport>true</DebuggerSupport>
14+
<EventSourceSupport>false</EventSourceSupport>
15+
<InvariantGlobalization>true</InvariantGlobalization>
1116
<ConcurrentGarbageCollection>false</ConcurrentGarbageCollection>
1217
<ServerGarbageCollection>true</ServerGarbageCollection>
1318
<RetainVMGarbageCollection>false</RetainVMGarbageCollection>
14-
<ThreadPoolMinThreads>2</ThreadPoolMinThreads>
15-
<ThreadPoolMaxThreads>9</ThreadPoolMaxThreads>
16-
<InvariantGlobalization>true</InvariantGlobalization>
19+
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
20+
<UseNativeHttpHandler>true</UseNativeHttpHandler>
21+
<MetadataUpdaterSupport>false</MetadataUpdaterSupport>
22+
<CustomResourceTypesSupport>false</CustomResourceTypesSupport>
23+
<UseSystemResourceKeys>true</UseSystemResourceKeys>
24+
<BuiltInComInteropSupport>false</BuiltInComInteropSupport>
25+
<_EnableConsumingManagedCodeFromNativeHosting>false</_EnableConsumingManagedCodeFromNativeHosting>
26+
<EnableCppCLIHostActivation>false</EnableCppCLIHostActivation>
27+
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
1728
<TieredCompilation>true</TieredCompilation>
1829
<TieredCompilationQuickJit>true</TieredCompilationQuickJit>
1930
<TieredCompilationQuickJitForLoops>true</TieredCompilationQuickJitForLoops>
2031
<StartupHookSupport>false</StartupHookSupport>
21-
<AutoreleasePoolSupport>false</AutoreleasePoolSupport>
22-
<CustomResourceTypesSupport>false</CustomResourceTypesSupport>
23-
<EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization>false</EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization>
24-
<EventSourceSupport>false</EventSourceSupport>
25-
<UseSystemResourceKeys>true</UseSystemResourceKeys>
2632
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
27-
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
28-
<DebuggerSupport>true</DebuggerSupport>
33+
<AutoreleasePoolSupport>false</AutoreleasePoolSupport>
34+
<ThreadPoolMinThreads>2</ThreadPoolMinThreads>
35+
<ThreadPoolMaxThreads>9</ThreadPoolMaxThreads>
2936
</PropertyGroup>
3037

3138
<ItemGroup>

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,11 @@ Copyright (c) .NET Foundation. All rights reserved.
404404
Value="$(UseNativeHttpHandler)"
405405
Trim="true" />
406406

407+
<RuntimeHostConfigurationOption Include="System.Reflection.Metadata.MetadataUpdater.IsSupported"
408+
Condition="'$(MetadataUpdaterSupport)' != ''"
409+
Value="$(MetadataUpdaterSupport)"
410+
Trim="true" />
411+
407412
<RuntimeHostConfigurationOption Include="System.Resources.ResourceManager.AllowCustomResourceTypes"
408413
Condition="'$(CustomResourceTypesSupport)' != ''"
409414
Value="$(CustomResourceTypesSupport)"

src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAProjectWithAllFeatures.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,32 @@ public void It_publishes_the_project_correctly(string targetFramework, string []
6363
var runtimeConfigJsonContents = File.ReadAllText(Path.Combine(publishDirectory.FullName, "TestApp.runtimeconfig.json"));
6464
var runtimeConfigJsonObject = JObject.Parse(runtimeConfigJsonContents);
6565

66+
// Keep this list sorted
6667
var baselineConfigJsonObject = JObject.Parse(@"{
6768
""runtimeOptions"": {
6869
""configProperties"": {
70+
""System.ComponentModel.TypeConverter.EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization"": false,
6971
""System.Diagnostics.Debugger.IsSupported"": true,
7072
""System.Diagnostics.Tracing.EventSource.IsSupported"": false,
7173
""System.Globalization.Invariant"": true,
7274
""System.GC.Concurrent"": false,
7375
""System.GC.Server"": true,
7476
""System.GC.RetainVM"": false,
7577
""System.Net.Http.EnableActivityPropagation"": false,
78+
""System.Net.Http.UseNativeHttpHandler"": true,
79+
""System.Reflection.Metadata.MetadataUpdater.IsSupported"": false,
80+
""System.Resources.ResourceManager.AllowCustomResourceTypes"": false,
7681
""System.Resources.UseSystemResourceKeys"": true,
82+
""System.Runtime.InteropServices.BuiltInComInterop.IsSupported"": false,
83+
""System.Runtime.InteropServices.EnableConsumingManagedCodeFromNativeHosting"": false,
84+
""System.Runtime.InteropServices.EnableCppCLIHostActivation"": false,
85+
""System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization"": false,
7786
""System.Runtime.TieredCompilation"": true,
7887
""System.Runtime.TieredCompilation.QuickJit"": true,
7988
""System.Runtime.TieredCompilation.QuickJitForLoops"": true,
8089
""System.StartupHookProvider.IsSupported"": false,
81-
""System.Threading.Thread.EnableAutoreleasePool"": false,
82-
""System.Resources.ResourceManager.AllowCustomResourceTypes"": false,
83-
""System.ComponentModel.TypeConverter.EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization"": false,
8490
""System.Text.Encoding.EnableUnsafeUTF7Encoding"": false,
91+
""System.Threading.Thread.EnableAutoreleasePool"": false,
8592
""System.Threading.ThreadPool.MinThreads"": 2,
8693
""System.Threading.ThreadPool.MaxThreads"": 9,
8794
""extraProperty"": true

0 commit comments

Comments
 (0)