diff --git a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.ExceptionMessages.cs b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.ExceptionMessages.cs
new file mode 100644
index 00000000000000..faa8529cfd73b8
--- /dev/null
+++ b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.ExceptionMessages.cs
@@ -0,0 +1,36 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace System.Text.Json.SourceGeneration
+{
+ public sealed partial class JsonSourceGenerator
+ {
+ private sealed partial class Emitter
+ {
+ ///
+ /// Unlike sourcegen warnings, exception messages should not be localized so we keep them in source.
+ ///
+ private static class ExceptionMessages
+ {
+ public const string InaccessibleJsonIncludePropertiesNotSupported =
+ "The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.";
+
+ public const string IncompatibleConverterType =
+ "The converter '{0}' is not compatible with the type '{1}'.";
+
+ public const string InitOnlyPropertyDeserializationNotSupported =
+ "Deserialization of init-only properties is currently not supported in source generation mode.";
+
+ public const string InvalidJsonConverterFactoryOutput =
+ "The converter '{0}' cannot return null or a JsonConverterFactory instance.";
+
+ public const string InvalidSerializablePropertyConfiguration =
+ "Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.";
+ };
+ }
+ }
+}
diff --git a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs
index 1af1ca43bae94f..131e08d0d0c2bf 100644
--- a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs
+++ b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs
@@ -324,7 +324,7 @@ private string GenerateForTypeWithUnknownConverter(TypeGenerationSpec typeMetada
}}
else
{{
- throw new {InvalidOperationExceptionTypeRef}(string.Format(""{SR.Exception_IncompatibleConverterType}"", converter.GetType(), typeToConvert));
+ throw new {InvalidOperationExceptionTypeRef}(string.Format(""{ExceptionMessages.IncompatibleConverterType}"", converter.GetType(), typeToConvert));
}}
}}");
}
@@ -333,7 +333,7 @@ private string GenerateForTypeWithUnknownConverter(TypeGenerationSpec typeMetada
metadataInitSource.Append($@"
if (!converter.CanConvert(typeToConvert))
{{
- throw new {InvalidOperationExceptionTypeRef}(string.Format(""{SR.Exception_IncompatibleConverterType}"", converter.GetType(), typeToConvert));
+ throw new {InvalidOperationExceptionTypeRef}(string.Format(""{ExceptionMessages.IncompatibleConverterType}"", converter.GetType(), typeToConvert));
}}");
}
@@ -716,7 +716,7 @@ private string GeneratePropMetadataInitFunc(TypeGenerationSpec typeGenerationSpe
{ DefaultIgnoreCondition: JsonIgnoreCondition.Always } => "getter: null",
{ CanUseGetter: true } => $"getter: static (obj) => (({declaringTypeCompilableName})obj).{clrPropertyName}",
{ CanUseGetter: false, HasJsonInclude: true }
- => @$"getter: static (obj) => throw new {InvalidOperationExceptionTypeRef}(""{SR.Format(SR.Exception_InaccessibleJsonIncludePropertiesNotSupported, typeGenerationSpec.Type.Name, memberMetadata.ClrName)}"")",
+ => @$"getter: static (obj) => throw new {InvalidOperationExceptionTypeRef}(""{string.Format(ExceptionMessages.InaccessibleJsonIncludePropertiesNotSupported, typeGenerationSpec.Type.Name, memberMetadata.ClrName)}"")",
_ => "getter: null"
};
@@ -724,13 +724,13 @@ private string GeneratePropMetadataInitFunc(TypeGenerationSpec typeGenerationSpe
{
{ DefaultIgnoreCondition: JsonIgnoreCondition.Always } => "setter: null",
{ CanUseSetter: true, IsInitOnlySetter: true }
- => @$"setter: static (obj, value) => throw new {InvalidOperationExceptionTypeRef}(""{SR.Exception_InitOnlyPropertyDeserializationNotSupported}"")",
+ => @$"setter: static (obj, value) => throw new {InvalidOperationExceptionTypeRef}(""{ExceptionMessages.InitOnlyPropertyDeserializationNotSupported}"")",
{ CanUseSetter: true } when typeGenerationSpec.IsValueType
=> $@"setter: static (obj, value) => {UnsafeTypeRef}.Unbox<{declaringTypeCompilableName}>(obj).{clrPropertyName} = value!",
{ CanUseSetter: true }
=> @$"setter: static (obj, value) => (({declaringTypeCompilableName})obj).{clrPropertyName} = value!",
{ CanUseSetter: false, HasJsonInclude: true }
- => @$"setter: static (obj, value) => throw new {InvalidOperationExceptionTypeRef}(""{SR.Format(SR.Exception_InaccessibleJsonIncludePropertiesNotSupported, typeGenerationSpec.Type.Name, memberMetadata.ClrName)}"")",
+ => @$"setter: static (obj, value) => throw new {InvalidOperationExceptionTypeRef}(""{string.Format(ExceptionMessages.InaccessibleJsonIncludePropertiesNotSupported, typeGenerationSpec.Type.Name, memberMetadata.ClrName)}"")",
_ => "setter: null",
};
@@ -824,7 +824,7 @@ private string GenerateFastPathFuncForObject(TypeGenerationSpec typeGenSpec)
out Dictionary? serializableProperties,
out bool castingRequiredForProps))
{
- string exceptionMessage = SR.Format(SR.Exception_InvalidSerializablePropertyConfiguration, typeRef);
+ string exceptionMessage = string.Format(ExceptionMessages.InvalidSerializablePropertyConfiguration, typeRef);
return GenerateFastPathFuncForType(
serializeMethodName,
@@ -1205,7 +1205,7 @@ private string GetFetchLogicForRuntimeSpecifiedCustomConverter()
converter = factory.CreateConverter(type, {OptionsInstanceVariableName});
if (converter == null || converter is {JsonConverterFactoryTypeRef})
{{
- throw new {InvalidOperationExceptionTypeRef}(string.Format(""{SR.Exception_InvalidJsonConverterFactoryOutput}"", factory.GetType()));
+ throw new {InvalidOperationExceptionTypeRef}(string.Format(""{ExceptionMessages.InvalidJsonConverterFactoryOutput}"", factory.GetType()));
}}
}}
@@ -1236,7 +1236,7 @@ private string GetFetchLogicForGetCustomConverter_TypesWithFactories()
{JsonConverterTypeRef}? converter = factory.CreateConverter(type, {Emitter.OptionsInstanceVariableName});
if (converter == null || converter is {JsonConverterFactoryTypeRef})
{{
- throw new {InvalidOperationExceptionTypeRef}(string.Format(""{SR.Exception_InvalidJsonConverterFactoryOutput}"", factory.GetType()));
+ throw new {InvalidOperationExceptionTypeRef}(string.Format(""{ExceptionMessages.InvalidJsonConverterFactoryOutput}"", factory.GetType()));
}}
return converter;
diff --git a/src/libraries/System.Text.Json/gen/Resources/Strings.resx b/src/libraries/System.Text.Json/gen/Resources/Strings.resx
index afe9e8ee10348b..1074f0eb468179 100644
--- a/src/libraries/System.Text.Json/gen/Resources/Strings.resx
+++ b/src/libraries/System.Text.Json/gen/Resources/Strings.resx
@@ -165,20 +165,4 @@
The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
- The converter '{0}' is not compatible with the type '{1}'.
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.cs.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.cs.xlf
index 47acea2b99ca83..3b613f37f21660 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.cs.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.cs.xlf
@@ -32,31 +32,6 @@
Duplicitní název typu
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.de.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.de.xlf
index ebbab56c240d5d..80ee5a4c3927c9 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.de.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.de.xlf
@@ -32,31 +32,6 @@
Doppelter Typname
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.es.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.es.xlf
index 451dd7da58f855..383c9b6e1cd3ce 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.es.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.es.xlf
@@ -32,31 +32,6 @@
Nombre de tipo duplicado.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.fr.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.fr.xlf
index f01bf2b5b93d3c..abf9fecd62cf1e 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.fr.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.fr.xlf
@@ -32,31 +32,6 @@
Nom de type dupliqué.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.it.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.it.xlf
index 839e8dedec8111..9edb25fc978211 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.it.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.it.xlf
@@ -32,31 +32,6 @@
Nome di tipo duplicato.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ja.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ja.xlf
index 258570825b412f..b3312d606a2dbd 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ja.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ja.xlf
@@ -32,31 +32,6 @@
重複した種類名。
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ko.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ko.xlf
index 7e19eb0623c659..1214ae9ffa70c2 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ko.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ko.xlf
@@ -32,31 +32,6 @@
중복된 형식 이름입니다.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pl.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pl.xlf
index 0703c93cd2cc4c..257006c2b352e0 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pl.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pl.xlf
@@ -32,31 +32,6 @@
Zduplikowana nazwa typu.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pt-BR.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pt-BR.xlf
index f7fa74197fae80..11492c23762969 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pt-BR.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pt-BR.xlf
@@ -32,31 +32,6 @@
Nome de tipo duplicado.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ru.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ru.xlf
index c996bbb9285351..f1bb2a252c0438 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ru.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ru.xlf
@@ -32,31 +32,6 @@
Дублирующееся имя типа.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.tr.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.tr.xlf
index 601a993580458b..3d5e138aebe4cb 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.tr.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.tr.xlf
@@ -32,31 +32,6 @@
Yinelenen tür adı.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hans.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hans.xlf
index 5d4ef30fb91d4e..a934f5c4d315f1 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hans.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hans.xlf
@@ -32,31 +32,6 @@
重复的类型名称。
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hant.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hant.xlf
index c8362e5f2be2cd..4e236ab87e0030 100644
--- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hant.xlf
+++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hant.xlf
@@ -32,31 +32,6 @@
重複類型名稱。
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
-
-
-
- The converter '{0}' is not compatible with the type '{1}'.
- The converter '{0}' is not compatible with the type '{1}'.
-
-
-
- Deserialization of init-only properties is currently not supported in source generation mode.
- Deserialization of init-only properties is currently not supported in source generation mode.
-
-
-
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
- The converter '{0}' cannot return null or a JsonConverterFactory instance.
-
-
-
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
- Invalid serializable-property configuration specified for type '{0}'. For more information, see 'JsonSourceGenerationMode.Serialization'.
-
- The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.The member '{0}.{1}' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.
diff --git a/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.targets b/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.targets
index 0153870dfd59c8..97d78152396485 100644
--- a/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.targets
+++ b/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.targets
@@ -1,4 +1,4 @@
-
+netstandard2.0$(MSBuildThisFileName)
@@ -43,6 +43,7 @@
+