diff --git a/eng/Versions.props b/eng/Versions.props
index b8cea6dbb133..9e82df415946 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -88,6 +88,10 @@
99.99.99-master-20200228.3
99.99.99-master-20200228.3
99.99.99-master-20200228.3
+
+ 3.6.0-3.20207.2
+ 3.0.0-beta2.final
+ 3.6.0.0
1.7.0
2.0.0-beta1.20253.1
diff --git a/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.Tests/JsonSourceGeneratorTests.cs b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.Tests/JsonSourceGeneratorTests.cs
new file mode 100644
index 000000000000..76381debddbb
--- /dev/null
+++ b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.Tests/JsonSourceGeneratorTests.cs
@@ -0,0 +1,17 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Xunit;
+
+namespace System.Text.Json.SourceGeneration.Tests
+{
+ public class JsonSerializerSouceGeneratorTests
+ {
+ [Fact]
+ public static void TestGeneratedCode()
+ {
+ Assert.Equal("Hello", HelloWorldGenerated.HelloWorld.SayHello());
+ }
+ }
+}
diff --git a/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.Tests/System.Text.Json.SourceGeneration.Tests.csproj b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.Tests/System.Text.Json.SourceGeneration.Tests.csproj
new file mode 100644
index 000000000000..e760d3494ff9
--- /dev/null
+++ b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.Tests/System.Text.Json.SourceGeneration.Tests.csproj
@@ -0,0 +1,19 @@
+
+
+ $(NetCoreAppCurrent);$(NetFrameworkCurrent)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.UnitTests/JsonSourceGeneratorTests.cs b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.UnitTests/JsonSourceGeneratorTests.cs
new file mode 100644
index 000000000000..d76fb67acbad
--- /dev/null
+++ b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.UnitTests/JsonSourceGeneratorTests.cs
@@ -0,0 +1,33 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Xunit;
+
+namespace System.Text.Json.SourceGeneration.UnitTests
+{
+ public static class GeneratorTests
+ {
+ [Fact]
+ public static void SourceGeneratorInitializationPass()
+ {
+ }
+
+ [Fact]
+ public static void SourceGeneratorInitializationFail()
+ {
+ }
+
+ [Fact]
+ public static void SourceGeneratorExecutionPass()
+ {
+ }
+
+ [Fact]
+ public static void SourceGeneratorExecutionFail()
+ {
+ }
+ }
+}
diff --git a/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.UnitTests/System.Text.Json.SourceGeneration.UnitTests.csproj b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.UnitTests/System.Text.Json.SourceGeneration.UnitTests.csproj
new file mode 100644
index 000000000000..6d652493b65f
--- /dev/null
+++ b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration.UnitTests/System.Text.Json.SourceGeneration.UnitTests.csproj
@@ -0,0 +1,21 @@
+
+
+ $(NetCoreAppCurrent);$(NetFrameworkCurrent)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration/JsonSourceGenerator.cs b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration/JsonSourceGenerator.cs
new file mode 100644
index 000000000000..8df499db2791
--- /dev/null
+++ b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration/JsonSourceGenerator.cs
@@ -0,0 +1,62 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Collections.Generic;
+
+namespace System.Text.Json.SourceGeneration
+{
+ ///
+ /// Base JsonSerializerSourceGenerator. This class will invoke CodeGenerator within Execute
+ /// to generate wanted output code for JsonSerializers.
+ ///
+ [Generator]
+ public class JsonSerializerSourceGenerator : ISourceGenerator
+ {
+ public void Execute(SourceGeneratorContext context)
+ {
+ // Foreach type found, call code generator.
+ StringBuilder sourceBuilder = new StringBuilder(@"
+using System;
+namespace HelloWorldGenerated
+{
+ public static class HelloWorld
+ {
+ public static string SayHello()
+ {
+ return ""Hello"";
+");
+
+ sourceBuilder.Append(@"
+ }
+ }
+}");
+
+ context.AddSource("helloWorldGenerated", SourceText.From(sourceBuilder.ToString(), Encoding.UTF8));
+ }
+
+ public void Initialize(InitializationContext context)
+ {
+ context.RegisterForSyntaxNotifications(() => new JsonSerializableSyntaxReceiver());
+ }
+
+ // Temporary function for now that reads all types. Should search types with attribute JsonSerializable.
+ internal class JsonSerializableSyntaxReceiver : ISyntaxReceiver
+ {
+ public List GeneratorInputTypes = new List();
+
+ public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
+ {
+ // Get all the type decl in all syntax tree.
+ if (syntaxNode is TypeDeclarationSyntax tds)
+ {
+ GeneratorInputTypes.Add(tds);
+ }
+ }
+ }
+
+ }
+}
diff --git a/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.csproj b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.csproj
new file mode 100644
index 000000000000..d48dde708aeb
--- /dev/null
+++ b/src/libraries/System.Text.Json/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.csproj
@@ -0,0 +1,24 @@
+
+
+
+ netstandard2.0
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/libraries/System.Text.Json/System.Text.Json.sln b/src/libraries/System.Text.Json/System.Text.Json.sln
index ef8cfccfcfb5..2b1df1cbd2ca 100644
--- a/src/libraries/System.Text.Json/System.Text.Json.sln
+++ b/src/libraries/System.Text.Json/System.Text.Json.sln
@@ -1,6 +1,7 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27213.1
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30204.135
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json.Tests", "tests\System.Text.Json.Tests.csproj", "{5F553243-042C-45C0-8E49-C739131E11C3}"
ProjectSection(ProjectDependencies) = postProject
@@ -20,7 +21,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E89
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2E666815-2EDB-464B-9DF6-380BF4789AD4}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{C42D5CBB-DAC5-4892-8E69-ED3183A6409E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{C42D5CBB-DAC5-4892-8E69-ED3183A6409E}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json.SourceGeneration", "System.Text.Json.SourceGeneration\System.Text.Json.SourceGeneration.csproj", "{08FDD841-6001-46AE-87A4-9DB2C7BAAC8C}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json.SourceGeneration.UnitTests", "System.Text.Json.SourceGeneration.UnitTests\System.Text.Json.SourceGeneration.UnitTests.csproj", "{37E5E8FB-1220-49B3-BE0E-CFFC079DA040}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Text.Json.SourceGeneration.Tests", "System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Tests.csproj", "{D6287A51-AE21-4680-BBF3-BE4BA4AFF311}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -44,6 +51,18 @@ Global
{C42D5CBB-DAC5-4892-8E69-ED3183A6409E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C42D5CBB-DAC5-4892-8E69-ED3183A6409E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C42D5CBB-DAC5-4892-8E69-ED3183A6409E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {08FDD841-6001-46AE-87A4-9DB2C7BAAC8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {08FDD841-6001-46AE-87A4-9DB2C7BAAC8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {08FDD841-6001-46AE-87A4-9DB2C7BAAC8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {08FDD841-6001-46AE-87A4-9DB2C7BAAC8C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {37E5E8FB-1220-49B3-BE0E-CFFC079DA040}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {37E5E8FB-1220-49B3-BE0E-CFFC079DA040}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {37E5E8FB-1220-49B3-BE0E-CFFC079DA040}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {37E5E8FB-1220-49B3-BE0E-CFFC079DA040}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D6287A51-AE21-4680-BBF3-BE4BA4AFF311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D6287A51-AE21-4680-BBF3-BE4BA4AFF311}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D6287A51-AE21-4680-BBF3-BE4BA4AFF311}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D6287A51-AE21-4680-BBF3-BE4BA4AFF311}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/libraries/System.Text.Json/pkg/System.Text.Json.pkgproj b/src/libraries/System.Text.Json/pkg/System.Text.Json.pkgproj
index c02e237aea1e..e965e79abd08 100644
--- a/src/libraries/System.Text.Json/pkg/System.Text.Json.pkgproj
+++ b/src/libraries/System.Text.Json/pkg/System.Text.Json.pkgproj
@@ -5,6 +5,7 @@
net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)
+