Always generate resx default values in ComponentModel.DataAnnotations (#42274)
authorEric Erhardt <eric.erhardt@microsoft.com>
Tue, 22 Sep 2020 22:12:28 +0000 (17:12 -0500)
committerGitHub <noreply@github.com>
Tue, 22 Sep 2020 22:12:28 +0000 (17:12 -0500)
Since many resource strings in ComponentModel.DataAnnotations contain messages that will be shown to end-users, we generate the "default value" string into the SR code. When a trimmed app strips the system resources, these strings will be used instead of the resource keys.

Fix #42257

src/libraries/System.ComponentModel.Annotations/src/System.ComponentModel.Annotations.csproj

index 8e376bb..bf49fb5 100644 (file)
@@ -2,6 +2,11 @@
   <PropertyGroup>
     <TargetFrameworks>netstandard2.1</TargetFrameworks>
     <Nullable>enable</Nullable>
+    <!--
+      Since many resource strings in this library are shown to an end-user,
+      always generate default resource string values which will be used when UseSystemResourceKeys is true in trimmed apps.
+    -->
+    <GenerateResxSourceIncludeDefaultValues>true</GenerateResxSourceIncludeDefaultValues>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs" />