Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Assets/TestProjects/KitchenSink/TestApp/TestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<CustomResourceTypesSupport>false</CustomResourceTypesSupport>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<DynamicCodeSupport>true</DynamicCodeSupport>
<JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
<BuiltInComInteropSupport>false</BuiltInComInteropSupport>
<_EnableConsumingManagedCodeFromNativeHosting>false</_EnableConsumingManagedCodeFromNativeHosting>
<EnableCppCLIHostActivation>false</EnableCppCLIHostActivation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,16 +558,21 @@ Copyright (c) .NET Foundation. All rights reserved.
Value="$(StartupHookSupport)"
Trim="true" />

<RuntimeHostConfigurationOption Include="System.Threading.Thread.EnableAutoreleasePool"
Condition="'$(AutoreleasePoolSupport)' != ''"
Value="$(AutoreleasePoolSupport)"
Trim="true" />

<RuntimeHostConfigurationOption Include="System.Text.Encoding.EnableUnsafeUTF7Encoding"
Condition="'$(EnableUnsafeUTF7Encoding)' != ''"
Value="$(EnableUnsafeUTF7Encoding)"
Trim="true" />

<RuntimeHostConfigurationOption Include="System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault"
Condition="'$(JsonSerializerIsReflectionEnabledByDefault)' != ''"
Value="$(JsonSerializerIsReflectionEnabledByDefault)"
Trim="true" />

<RuntimeHostConfigurationOption Include="System.Threading.Thread.EnableAutoreleasePool"
Condition="'$(AutoreleasePoolSupport)' != ''"
Value="$(AutoreleasePoolSupport)"
Trim="true" />

<RuntimeHostConfigurationOption Include="System.Threading.ThreadPool.MinThreads"
Condition="'$(ThreadPoolMinThreads)' != ''"
Value="$(ThreadPoolMinThreads)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public void It_publishes_the_project_correctly(string targetFramework, string []
""System.Runtime.TieredPGO"": true,
""System.StartupHookProvider.IsSupported"": false,
""System.Text.Encoding.EnableUnsafeUTF7Encoding"": false,
""System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault"": false,
""System.Threading.Thread.EnableAutoreleasePool"": false,
""System.Threading.ThreadPool.MinThreads"": 2,
""System.Threading.ThreadPool.MaxThreads"": 9,
Expand Down
3 changes: 3 additions & 0 deletions src/Tests/Microsoft.NET.Sdk.Web.Tests/PublishTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public void TrimmingOptions_Are_Defaulted_Correctly_On_Trimmed_Apps(string targe

configProperties["Microsoft.AspNetCore.EnsureJsonTrimmability"].GetValue<bool>()
.Should().BeTrue();
configProperties["System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault"].GetValue<bool>()
.Should().BeFalse();
}

[Theory]
Expand Down Expand Up @@ -81,6 +83,7 @@ public void TrimmingOptions_Are_Defaulted_Correctly_On_Aot_Apps(string targetFra
var responseFileContents = File.ReadLines(responseFile);

responseFileContents.Should().Contain("--feature:Microsoft.AspNetCore.EnsureJsonTrimmability=true");
responseFileContents.Should().Contain("--feature:System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault=false");
File.Exists(Path.Combine(outputDirectory, "web.config")).Should().BeFalse();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup Condition="'$(PublishTrimmed)' == 'true' Or '$(PublishAot)' == 'true'">
<!-- Runtime feature defaults to trim unnecessary code -->
<EnsureAspNetCoreJsonTrimmability Condition="'$(EnsureAspNetCoreJsonTrimmability)' == ''">true</EnsureAspNetCoreJsonTrimmability>
<JsonSerializerIsReflectionEnabledByDefault Condition="'$(JsonSerializerIsReflectionEnabledByDefault)' == ''">false</JsonSerializerIsReflectionEnabledByDefault>
</PropertyGroup>

<!--
Expand Down