diff --git a/Directory.Build.props b/Directory.Build.props
index b6fc8cf18..fc7c5f0f7 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -28,11 +28,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/Directory.Build.rsp b/Directory.Build.rsp
new file mode 100644
index 000000000..9a833a034
--- /dev/null
+++ b/Directory.Build.rsp
@@ -0,0 +1,16 @@
+#------------------------------------------------------------------------------
+# This file contains command-line options that MSBuild will process as part of
+# every build, unless the "/noautoresponse" switch is specified.
+#
+# MSBuild processes the options in this file first, before processing the
+# options on the command line. As a result, options on the command line can
+# override the options in this file. However, depending on the options being
+# set, the overriding can also result in conflicts.
+#
+# NOTE: The "/noautoresponse" switch cannot be specified in this file, nor in
+# any response file that is referenced by this file.
+#------------------------------------------------------------------------------
+/nr:false
+/m
+/verbosity:minimal
+/clp:Summary;ForceNoAlign
diff --git a/MessagePack.sln b/MessagePack.sln
index 6157da344..77d762b8a 100644
--- a/MessagePack.sln
+++ b/MessagePack.sln
@@ -34,8 +34,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.ImmutableCollec
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePackAnalyzer", "src\MessagePackAnalyzer\MessagePackAnalyzer.csproj", "{2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MessagePackAnalyzer.Vsix", "src\MessagePackAnalyzer.Vsix\MessagePackAnalyzer.Vsix.csproj", "{09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerfNetFramework", "sandbox\PerfNetFramework\PerfNetFramework.csproj", "{014A3DCE-50A6-4774-A4C1-C66EEAB67133}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.AspNetCoreMvcFormatter", "src\MessagePack.AspNetCoreMvcFormatter\MessagePack.AspNetCoreMvcFormatter.csproj", "{17831017-C29C-4A48-B159-849BCE5079FB}"
@@ -88,228 +86,122 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.Experimental",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.Experimental.Tests", "tests\MessagePack.Experimental.Tests\MessagePack.Experimental.Tests.csproj", "{8AB40D1C-1134-4D77-B39A-19AEDC729450}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.GeneratedCode.Tests", "tests\MessagePack.GeneratedCode.Tests\MessagePack.GeneratedCode.Tests.csproj", "{D4CE7347-CEBE-46E5-BD12-1319573B6C5E}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
- Debug|NoVSIX = Debug|NoVSIX
Release|Any CPU = Release|Any CPU
- Release|NoVSIX = Release|NoVSIX
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Release|Any CPU.Build.0 = Release|Any CPU
- {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Release|NoVSIX.Build.0 = Release|Any CPU
{9E1A55CA-711D-4F58-A332-735960E3434C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E1A55CA-711D-4F58-A332-735960E3434C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9E1A55CA-711D-4F58-A332-735960E3434C}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {9E1A55CA-711D-4F58-A332-735960E3434C}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{9E1A55CA-711D-4F58-A332-735960E3434C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E1A55CA-711D-4F58-A332-735960E3434C}.Release|Any CPU.Build.0 = Release|Any CPU
- {9E1A55CA-711D-4F58-A332-735960E3434C}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {9E1A55CA-711D-4F58-A332-735960E3434C}.Release|NoVSIX.Build.0 = Release|Any CPU
{ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Release|Any CPU.Build.0 = Release|Any CPU
- {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Release|NoVSIX.Build.0 = Release|Any CPU
{8E511130-F838-4B47-842B-0FB27AD175B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E511130-F838-4B47-842B-0FB27AD175B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8E511130-F838-4B47-842B-0FB27AD175B5}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {8E511130-F838-4B47-842B-0FB27AD175B5}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{8E511130-F838-4B47-842B-0FB27AD175B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E511130-F838-4B47-842B-0FB27AD175B5}.Release|Any CPU.Build.0 = Release|Any CPU
- {8E511130-F838-4B47-842B-0FB27AD175B5}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {8E511130-F838-4B47-842B-0FB27AD175B5}.Release|NoVSIX.Build.0 = Release|Any CPU
{3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Release|Any CPU.Build.0 = Release|Any CPU
- {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Release|NoVSIX.Build.0 = Release|Any CPU
{C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Release|Any CPU.Build.0 = Release|Any CPU
- {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Release|NoVSIX.Build.0 = Release|Any CPU
{166A16C0-B89F-41AF-956A-235C6CA62C25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{166A16C0-B89F-41AF-956A-235C6CA62C25}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {166A16C0-B89F-41AF-956A-235C6CA62C25}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {166A16C0-B89F-41AF-956A-235C6CA62C25}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{166A16C0-B89F-41AF-956A-235C6CA62C25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{166A16C0-B89F-41AF-956A-235C6CA62C25}.Release|Any CPU.Build.0 = Release|Any CPU
- {166A16C0-B89F-41AF-956A-235C6CA62C25}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {166A16C0-B89F-41AF-956A-235C6CA62C25}.Release|NoVSIX.Build.0 = Release|Any CPU
{E066F547-7261-4561-AEFC-E64DBFD874F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E066F547-7261-4561-AEFC-E64DBFD874F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E066F547-7261-4561-AEFC-E64DBFD874F8}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {E066F547-7261-4561-AEFC-E64DBFD874F8}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{E066F547-7261-4561-AEFC-E64DBFD874F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E066F547-7261-4561-AEFC-E64DBFD874F8}.Release|Any CPU.Build.0 = Release|Any CPU
- {E066F547-7261-4561-AEFC-E64DBFD874F8}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {E066F547-7261-4561-AEFC-E64DBFD874F8}.Release|NoVSIX.Build.0 = Release|Any CPU
{2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Release|Any CPU.Build.0 = Release|Any CPU
- {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Release|NoVSIX.Build.0 = Release|Any CPU
- {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Release|Any CPU.Build.0 = Release|Any CPU
- {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Release|NoVSIX.ActiveCfg = Release|Any CPU
{014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Release|Any CPU.ActiveCfg = Release|Any CPU
{014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Release|Any CPU.Build.0 = Release|Any CPU
- {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Release|NoVSIX.Build.0 = Release|Any CPU
{17831017-C29C-4A48-B159-849BCE5079FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{17831017-C29C-4A48-B159-849BCE5079FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {17831017-C29C-4A48-B159-849BCE5079FB}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {17831017-C29C-4A48-B159-849BCE5079FB}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{17831017-C29C-4A48-B159-849BCE5079FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17831017-C29C-4A48-B159-849BCE5079FB}.Release|Any CPU.Build.0 = Release|Any CPU
- {17831017-C29C-4A48-B159-849BCE5079FB}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {17831017-C29C-4A48-B159-849BCE5079FB}.Release|NoVSIX.Build.0 = Release|Any CPU
{814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Release|Any CPU.Build.0 = Release|Any CPU
- {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Release|NoVSIX.Build.0 = Release|Any CPU
{2A32A538-BA26-4D89-85D0-E4249AFA0837}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A32A538-BA26-4D89-85D0-E4249AFA0837}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{2A32A538-BA26-4D89-85D0-E4249AFA0837}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A32A538-BA26-4D89-85D0-E4249AFA0837}.Release|Any CPU.Build.0 = Release|Any CPU
- {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Release|NoVSIX.Build.0 = Release|Any CPU
{79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Release|Any CPU.Build.0 = Release|Any CPU
- {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Release|NoVSIX.Build.0 = Release|Any CPU
{85763F30-7733-44AB-89AB-D1B64F6E0D93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85763F30-7733-44AB-89AB-D1B64F6E0D93}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{85763F30-7733-44AB-89AB-D1B64F6E0D93}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85763F30-7733-44AB-89AB-D1B64F6E0D93}.Release|Any CPU.Build.0 = Release|Any CPU
- {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Release|NoVSIX.Build.0 = Release|Any CPU
{4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Release|Any CPU.Build.0 = Release|Any CPU
- {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Release|NoVSIX.Build.0 = Release|Any CPU
{C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Release|Any CPU.Build.0 = Release|Any CPU
- {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Release|NoVSIX.Build.0 = Release|Any CPU
{8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Release|Any CPU.Build.0 = Release|Any CPU
- {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Release|NoVSIX.Build.0 = Release|Any CPU
{9962132D-A271-4E68-ACC1-18FA93462552}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9962132D-A271-4E68-ACC1-18FA93462552}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9962132D-A271-4E68-ACC1-18FA93462552}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {9962132D-A271-4E68-ACC1-18FA93462552}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{9962132D-A271-4E68-ACC1-18FA93462552}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9962132D-A271-4E68-ACC1-18FA93462552}.Release|Any CPU.Build.0 = Release|Any CPU
- {9962132D-A271-4E68-ACC1-18FA93462552}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {9962132D-A271-4E68-ACC1-18FA93462552}.Release|NoVSIX.Build.0 = Release|Any CPU
{32C91908-5CAD-4C95-B240-ACBBACAC9476}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32C91908-5CAD-4C95-B240-ACBBACAC9476}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{32C91908-5CAD-4C95-B240-ACBBACAC9476}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32C91908-5CAD-4C95-B240-ACBBACAC9476}.Release|Any CPU.Build.0 = Release|Any CPU
- {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Release|NoVSIX.Build.0 = Release|Any CPU
{8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Release|Any CPU.Build.0 = Release|Any CPU
- {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Release|NoVSIX.Build.0 = Release|Any CPU
{7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Release|Any CPU.Build.0 = Release|Any CPU
- {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Release|NoVSIX.Build.0 = Release|Any CPU
{6AC51E68-4681-463A-B4B6-BD53517244B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AC51E68-4681-463A-B4B6-BD53517244B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6AC51E68-4681-463A-B4B6-BD53517244B2}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {6AC51E68-4681-463A-B4B6-BD53517244B2}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{6AC51E68-4681-463A-B4B6-BD53517244B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AC51E68-4681-463A-B4B6-BD53517244B2}.Release|Any CPU.Build.0 = Release|Any CPU
- {6AC51E68-4681-463A-B4B6-BD53517244B2}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {6AC51E68-4681-463A-B4B6-BD53517244B2}.Release|NoVSIX.Build.0 = Release|Any CPU
{4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Release|Any CPU.Build.0 = Release|Any CPU
- {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Release|NoVSIX.Build.0 = Release|Any CPU
{AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Release|Any CPU.Build.0 = Release|Any CPU
- {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Release|NoVSIX.Build.0 = Release|Any CPU
{8AB40D1C-1134-4D77-B39A-19AEDC729450}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8AB40D1C-1134-4D77-B39A-19AEDC729450}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU
- {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Debug|NoVSIX.Build.0 = Debug|Any CPU
{8AB40D1C-1134-4D77-B39A-19AEDC729450}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8AB40D1C-1134-4D77-B39A-19AEDC729450}.Release|Any CPU.Build.0 = Release|Any CPU
- {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Release|NoVSIX.ActiveCfg = Release|Any CPU
- {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Release|NoVSIX.Build.0 = Release|Any CPU
+ {D4CE7347-CEBE-46E5-BD12-1319573B6C5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D4CE7347-CEBE-46E5-BD12-1319573B6C5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D4CE7347-CEBE-46E5-BD12-1319573B6C5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D4CE7347-CEBE-46E5-BD12-1319573B6C5E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -324,7 +216,6 @@ Global
{166A16C0-B89F-41AF-956A-235C6CA62C25} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC}
{E066F547-7261-4561-AEFC-E64DBFD874F8} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC}
{2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC}
- {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC}
{014A3DCE-50A6-4774-A4C1-C66EEAB67133} = {BF4C4202-5015-4FBD-80E6-D0F36A06F700}
{17831017-C29C-4A48-B159-849BCE5079FB} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC}
{814F94D6-1413-4ACB-B1B5-A3488CAA1E6B} = {BF4C4202-5015-4FBD-80E6-D0F36A06F700}
@@ -342,6 +233,7 @@ Global
{4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637} = {51A614B0-E583-4DD2-AC7D-6A65634582E0}
{AC2503A7-736D-4AE6-9355-CF35D9DF6139} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC}
{8AB40D1C-1134-4D77-B39A-19AEDC729450} = {19FE674A-AC94-4E7E-B24C-2285D1D04CDE}
+ {D4CE7347-CEBE-46E5-BD12-1319573B6C5E} = {19FE674A-AC94-4E7E-B24C-2285D1D04CDE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B3911209-2DBF-47F8-98F6-BBC0EDFE63DE}
diff --git a/README.md b/README.md
index 87d4c0f32..27af11f5b 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
[][Releases]
[](https://gitter.im/MessagePack-CSharp/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-[](https://dev.azure.com/ils0086/MessagePack-CSharp/_build/latest?definitionId=2)
+[](https://dev.azure.com/ils0086/MessagePack-CSharp/_build/latest?definitionId=2&branchName=master)
The extremely fast [MessagePack](http://msgpack.org/) serializer for C#.
It is 10x faster than [MsgPack-Cli](https://github.com/msgpack/msgpack-cli) and outperforms other C# serializers. MessagePack for C# also ships with built-in support for LZ4 compression - an extremely fast compression algorithm. Performance is important, particularly in applications like games, distributed computing, microservices, or data caches.
@@ -34,6 +34,7 @@ MessagePack has a compact binary size and a full set of general purpose expressi
- [Security](#security)
- [Performance](#performance)
- [Deserialization Performance for different options](#deserialization-performance-for-different-options)
+ - [String interning](#string-interning)
- [LZ4 Compression](#lz4-compression)
- [Attributions](#attributions)
- [Comparison with protobuf, JSON, ZeroFormatter](#comparison-with-protobuf-json-zeroformatter)
@@ -184,7 +185,7 @@ These types can serialize by default:
* Primitives (`int`, `string`, etc...), `Enum`s, `Nullable<>`, `Lazy<>`
* `TimeSpan`, `DateTime`, `DateTimeOffset`
* `Guid`, `Uri`, `Version`, `StringBuilder`
-* `BigInteger`, `Complex`
+* `BigInteger`, `Complex`, `Half`
* `Array[]`, `Array[,]`, `Array[,,]`, `Array[,,,]`, `ArraySegment<>`, `BitArray`
* `KeyValuePair<,>`, `Tuple<,...>`, `ValueTuple<,...>`
* `ArrayList`, `Hashtable`
@@ -404,6 +405,8 @@ public struct Point
}
```
+### C# 9 `record` types
+
C# 9.0 record with primary constructor is similar immutable object, also supports serialize/deserialize.
```csharp
@@ -412,8 +415,26 @@ C# 9.0 record with primary constructor is similar immutable object, also support
// use property: to set KeyAttribute
[MessagePackObject] public record Point([property:Key(0)] int X, [property: Key(1)] int Y);
+
+// Or use explicit properties
+[MessagePackObject]
+public record Person
+{
+ [Key(0)]
+ public string FirstName { get; init; }
+
+ [Key(1)]
+ public string LastName { get; init; }
+}
```
+### C# 9 `init` property setter limitations
+
+When using `init` property setters in _generic_ classes, [a CLR bug](https://github.com/neuecc/MessagePack-CSharp/issues/1134) prevents our most efficient code generation from invoking the property setter.
+As a result, you should avoid using `init` on property setters in generic classes when using the public-only `DynamicObjectResolver`/`StandardResolver`.
+
+When using the `DynamicObjectResolverAllowPrivate`/`StandardResolverAllowPrivate` resolver the bug does not apply and you may use `init` without restriction.
+
## Serialization Callback
Objects implementing the `IMessagePackSerializationCallbackReceiver` interface will received `OnBeforeSerialize` and `OnAfterDeserialize` calls during serialization/deserialization.
@@ -679,7 +700,7 @@ Benchmarks comparing MessagePack For C# to other serializers were run on `Window
* Avoid string key decoding for lookup maps (string key and use automata based name lookup with inlined IL code generation, see: [AutomataDictionary](https://github.com/neuecc/MessagePack-CSharp/blob/bcedbce3fd98cb294210d6b4a22bdc4c75ccd916/src/MessagePack/Internal/AutomataDictionary.cs)
* To encode string keys, use pre-generated member name bytes and fixed sized byte array copies in IL, see: [UnsafeMemory.cs](https://github.com/neuecc/MessagePack-CSharp/blob/f17ddc5d107d3a2f66f60398b214ef87919ff892/src/MessagePack/Internal/UnsafeMemory.cs)
-Before creating this library, I implemented a fast fast serializer with [ZeroFormatter#Performance](https://github.com/neuecc/ZeroFormatter#performance). This is a further evolved implementation. MessagePack for C# is always fast and optimized for all types (primitive, small struct, large object, any collections).
+Before creating this library, I implemented a fast serializer with [ZeroFormatter#Performance](https://github.com/neuecc/ZeroFormatter#performance). This is a further evolved implementation. MessagePack for C# is always fast and optimized for all types (primitive, small struct, large object, any collections).
### Deserialization Performance for different options
@@ -738,6 +759,49 @@ Extra note, this is serialization benchmark result.
Of course, `IntKey` is fastest but `StringKey` also performs reasonably well.
+### String interning
+
+The msgpack format does not provide for reusing strings in the data stream.
+This naturally leads the deserializer to create a new `string` object for every string encountered,
+even if it is equal to another string previously encountered.
+
+When deserializing data that may contain the same strings repeatedly it can be worthwhile
+to have the deserializer take a little extra time to check whether it has seen a given string before
+and reuse it if it has.
+
+To enable string interning on *all* string values, use a resolver that specifies `StringInterningFormatter`
+before any of the standard ones, like this:
+
+```cs
+var options = MessagePackSerializerOptions.Standard.WithResolver(
+ CompositeResolver.Create(
+ new IMessagePackFormatter[] { new StringInterningFormatter() },
+ new IFormatterResolver[] { StandardResolver.Instance }));
+
+MessagePackSerializer.Deserialize(data, options);
+```
+
+If you know which fields of a particular type are likely to contain duplicate strings,
+you can apply the string interning formatter to just those fields so the deserializer only pays
+for the interned string check where it matters most.
+Note that this technique requires a `[MessagePackObject]` or `[DataContract]` class.
+
+```cs
+[MessagePackObject]
+public class ClassOfStrings
+{
+ [Key(0)]
+ [MessagePackFormatter(typeof(StringInterningFormatter))]
+ public string InternedString { get; set; }
+
+ [Key(1)]
+ public string OrdinaryString { get; set; }
+}
+```
+
+If you are writing your own formatter for some type that contains strings,
+you can call on the `StringInterningFormatter` directly from your formatter as well for the strings.
+
## LZ4 Compression
MessagePack is a fast and *compact* format but it is not compression. [LZ4](https://github.com/lz4/lz4) is an extremely fast compression algorithm, and using it MessagePack for C# can achieve extremely fast performance as well as extremely compact binary sizes!
@@ -1068,7 +1132,7 @@ Here is an example of such a custom formatter implementation. Note its use of th
```csharp
/// Serializes a by its full path as a string.
-public class FileInfoFormatter : IMessagePackFormatter
+public class FileInfoFormatter : IMessagePackFormatter
{
public void Serialize(
ref MessagePackWriter writer, FileInfo value, MessagePackSerializerOptions options)
@@ -1111,7 +1175,7 @@ you must precede it with a map or array header. You must read the entire map/arr
For example:
```csharp
-public class MySpecialObjectFormatter : IMessagePackFormatter
+public class MySpecialObjectFormatter : IMessagePackFormatter
{
public void Serialize(
ref MessagePackWriter writer, MySpecialObject value, MessagePackSerializerOptions options)
@@ -1149,15 +1213,18 @@ public class MySpecialObjectFormatter : IMessagePackFormatter))
- {
- return Activator.CreateInstance(typeof(ValueTupleFormatter<,>).MakeGenericType(t.GenericTypeArguments));
- }
-
// If type can not get, must return null for fallback mechanism.
return null;
}
@@ -1435,30 +1496,44 @@ var resolver = MessagePack.Resolvers.CompositeResolver.Create(
## Reserved Extension Types
-MessagePack for C# already used some MessagePack extension type codes, be careful to use same ext code.
+MessagePack for C# already used some MessagePack extension type codes, be careful to avoid using the same ext code for other purposes.
+
+Range | Reserved for
+--|--
+\[-128, -1\] | Reserved by the msgpack spec for predefined types
+\[30, 120) | Reserved for this library's use to support common types in .NET
+
+This leaves the following ranges for your use:
+
+- \[0, 30)
+- \[120, 127]
+
+Within the *reserved* ranges, this library defines or implements extensions that use these type codes:
| Code | Type | Use by |
-| --- | --- | --- |
-| -1 | DateTime | MessagePack-spec reserved for timestamp |
-| 30 | Vector2[] | for Unity, UnsafeBlitFormatter |
-| 31 | Vector3[] | for Unity, UnsafeBlitFormatter |
-| 32 | Vector4[] | for Unity, UnsafeBlitFormatter |
-| 33 | Quaternion[] | for Unity, UnsafeBlitFormatter |
-| 34 | Color[] | for Unity, UnsafeBlitFormatter |
-| 35 | Bounds[] | for Unity, UnsafeBlitFormatter |
-| 36 | Rect[] | for Unity, UnsafeBlitFormatter |
-| 37 | Int[] | for Unity, UnsafeBlitFormatter |
-| 38 | Float[] | for Unity, UnsafeBlitFormatter |
-| 39 | Double[] | for Unity, UnsafeBlitFormatter |
-| 98 | All | MessagePackCompression.Lz4BlockArray |
-| 99 | All | MessagePackCompression.Lz4Block |
-| 100 | object | TypelessFormatter |
+| ---- | ---- | --- |
+| -1 | DateTime | MessagePack-spec reserved for timestamp |
+| 30 | Vector2[] | for Unity, UnsafeBlitFormatter |
+| 31 | Vector3[] | for Unity, UnsafeBlitFormatter |
+| 32 | Vector4[] | for Unity, UnsafeBlitFormatter |
+| 33 | Quaternion[] | for Unity, UnsafeBlitFormatter |
+| 34 | Color[] | for Unity, UnsafeBlitFormatter |
+| 35 | Bounds[] | for Unity, UnsafeBlitFormatter |
+| 36 | Rect[] | for Unity, UnsafeBlitFormatter |
+| 37 | Int[] | for Unity, UnsafeBlitFormatter |
+| 38 | Float[] | for Unity, UnsafeBlitFormatter |
+| 39 | Double[] | for Unity, UnsafeBlitFormatter |
+| 98 | All | MessagePackCompression.Lz4BlockArray |
+| 99 | All | MessagePackCompression.Lz4Block |
+| 100 | object | TypelessFormatter |
## Unity support
Unity lowest supported version is `2018.3`, API Compatibility Level supports both `.NET 4.x` and `.NET Standard 2.0`.
-You can install the `unitypackage` from the [releases][Releases] page. If your build targets PC, you can use it as is, but if your build targets IL2CPP, you can not use `Dynamic***Resolver`, so it is required to use pre-code generation. Please see [pre-code generation section](#aot).
+You can install the `unitypackage` from the [releases][Releases] page.
+If your build targets .NET Framework 4.x and runs on mono, you can use it as is.
+But if your build targets IL2CPP, you can not use `Dynamic***Resolver`, so it is required to use pre-code generation. Please see [pre-code generation section](#aot).
MessagePack for C# includes some additional `System.*.dll` libraries that originally provides in NuGet. They are located under `Plugins`. If other packages use these libraries (e.g. Unity Collections package using `System.Runtime.CompilerServices.Unsafe.dll`), to avoid conflicts, please delete the DLL under `Plugins`.
@@ -1504,7 +1579,8 @@ If you want to share a class between Unity and a server, you can use `SharedProj
By default, MessagePack for C# serializes custom objects by [generating IL](https://msdn.microsoft.com/en-us/library/system.reflection.emit.ilgenerator.aspx) on the fly at runtime to create custom, highly tuned formatters for each type. This code generation has a minor upfront performance cost.
Because strict-AOT environments such as Xamarin and Unity IL2CPP forbid runtime code generation, MessagePack provides a way for you to run a code generator ahead of time as well.
-> Note: When Unity targets the PC it allows dynamic code generation, so AOT is not required.
+> Note: When using Unity, dynamic code generation only works when targeting .NET Framework 4.x + mono runtime.
+For all other Unity targets, AOT is required.
If you want to avoid the upfront dynamic generation cost or you need to run on Xamarin or Unity, you need AOT code generation. `mpc` (MessagePackCompiler) is the code generator of MessagePack for C#. mpc uses [Roslyn](https://github.com/dotnet/roslyn) to analyze source code.
@@ -1526,7 +1602,7 @@ Check in your `.config\dotnet-tools.json` file. On another machine you can "rest
Once you have the tool installed, simply invoke using `dotnet mpc` within your repo:
```
-dotnet mpc -h
+dotnet mpc --help
```
Alternatively, you can download mpc from the [releases][Releases] page, that includes platform native binaries (that don't require a separate dotnet runtime).
@@ -1535,7 +1611,7 @@ Alternatively, you can download mpc from the [releases][Releases] page, that inc
Usage: mpc [options...]
Options:
- -i, -input Input path of analyze csproj or directory, if input multiple csproj split with ','. (Required)
+ -i, -input Input path to MSBuild project file or the directory containing Unity source files. (Required)
-o, -output Output file path(.cs) or directory(multiple generate file). (Required)
-c, -conditionalSymbol Conditional compiler symbols, split with ','. (Default: null)
-r, -resolverName Set resolver name. (Default: GeneratedResolver)
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index a3206040b..d18997c3b 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -19,7 +19,7 @@ stages:
jobs:
- job: Windows
pool:
- vmImage: windows-2019
+ vmImage: windows-2022
steps:
- checkout: self
clean: true
@@ -33,7 +33,9 @@ stages:
- job: Unity
pool:
name: CustomAgents
- demands: UNITYHUB_EDITORS_FOLDER_LOCATION
+ demands:
+ - UNITYHUB_EDITORS_FOLDER_LOCATION
+ - UNITYVERSION -equals 2019.1
steps:
- checkout: self
clean: true
@@ -42,7 +44,7 @@ stages:
- job: Linux
pool:
- vmImage: Ubuntu 16.04
+ vmImage: ubuntu-20.04
steps:
- checkout: self
clean: true
@@ -51,7 +53,7 @@ stages:
- job: macOS
pool:
- vmImage: macOS-10.15
+ vmImage: macOS-11
steps:
- checkout: self
clean: true
@@ -62,7 +64,7 @@ stages:
# It also helps exercise mpc so bugs don't go unnoticed.
- job: codegen_diff
pool:
- vmImage: ubuntu-latest
+ vmImage: ubuntu-20.04
steps:
- checkout: self
clean: true
@@ -82,7 +84,7 @@ stages:
jobs:
- job: push
pool:
- vmImage: ubuntu-latest
+ vmImage: ubuntu-20.04
steps:
- download: current
artifact: nuget
diff --git a/azure-pipelines/Get-TempToolsPath.ps1 b/azure-pipelines/Get-TempToolsPath.ps1
index 97c552c06..bb3da8e33 100644
--- a/azure-pipelines/Get-TempToolsPath.ps1
+++ b/azure-pipelines/Get-TempToolsPath.ps1
@@ -1,7 +1,7 @@
-if ($env:AGENT_TOOLSDIRECTORY) {
- $path = "$env:AGENT_TOOLSDIRECTORY\vs-platform\tools"
+if ($env:AGENT_TEMPDIRECTORY) {
+ $path = "$env:AGENT_TEMPDIRECTORY\$env:BUILD_BUILDID"
} elseif ($env:localappdata) {
- $path = "$env:localappdata\vs-platform\tools"
+ $path = "$env:localappdata\gitrepos\tools"
} else {
$path = "$PSScriptRoot\..\obj\tools"
}
diff --git a/azure-pipelines/Get-nbgv.ps1 b/azure-pipelines/Get-nbgv.ps1
index 925eecddb..a5be2cf7c 100644
--- a/azure-pipelines/Get-nbgv.ps1
+++ b/azure-pipelines/Get-nbgv.ps1
@@ -10,11 +10,7 @@ if ($existingTool) {
return $existingTool.Path
}
-if ($env:AGENT_TEMPDIRECTORY) {
- $toolInstallDir = "$env:AGENT_TEMPDIRECTORY/$env:BUILD_BUILDID"
-} else {
- $toolInstallDir = "$PSScriptRoot/../obj/tools"
-}
+$toolInstallDir = & "$PSScriptRoot/Get-TempToolsPath.ps1"
$toolPath = "$toolInstallDir/nbgv"
if (!(Test-Path $toolInstallDir)) { New-Item -Path $toolInstallDir -ItemType Directory | Out-Null }
diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml
index 7a26369d3..99f5524dd 100644
--- a/azure-pipelines/build.yml
+++ b/azure-pipelines/build.yml
@@ -1,12 +1,8 @@
steps:
-# Use VSBuild to pack because `dotnet pack` can't build VSIX projects.
-- task: VSBuild@1
+- task: DotNetCoreCLI@2
inputs:
- vsVersion: 16.0
- solution: MessagePack.sln
- msbuildArgs: /t:build,pack /m /v:m /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog"
- platform: $(BuildPlatform)
- configuration: $(BuildConfiguration)
+ command: build
+ arguments: --configuration $(BuildConfiguration) /t:build,pack /m /v:m /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog"
displayName: Build MessagePack.sln
- task: DotNetCoreCLI@2
diff --git a/azure-pipelines/build_nonWindows.yml b/azure-pipelines/build_nonWindows.yml
index af79463eb..cf3f51d76 100644
--- a/azure-pipelines/build_nonWindows.yml
+++ b/azure-pipelines/build_nonWindows.yml
@@ -3,15 +3,23 @@ steps:
displayName: Build MessagePack.sln
inputs:
command: build
- arguments: --no-restore /p:platform=NoVSIX -c $(BuildConfiguration)
+ arguments: --no-restore -c $(BuildConfiguration)
- task: DotNetCoreCLI@2
- displayName: Run MessagePack.Tests (netcoreapp2.1)
+ displayName: Run MessagePack.Tests (netcoreapp3.1)
inputs:
command: test
projects: tests/MessagePack.Tests/MessagePack.Tests.csproj
- arguments: --no-build -c $(BuildConfiguration) -f netcoreapp2.1 -v n --settings "$(Build.Repository.LocalPath)/azure-pipelines/$(Agent.OS).runsettings"
- testRunTitle: netcoreapp2.1-$(Agent.JobName)
+ arguments: --no-build -c $(BuildConfiguration) -f netcoreapp3.1 -v n --settings "$(Build.Repository.LocalPath)/azure-pipelines/$(Agent.OS).runsettings"
+ testRunTitle: netcoreapp3.1-$(Agent.JobName)
+
+- task: DotNetCoreCLI@2
+ displayName: Run MessagePack.Tests (net6.0)
+ inputs:
+ command: test
+ projects: tests/MessagePack.Tests/MessagePack.Tests.csproj
+ arguments: --no-build -c $(BuildConfiguration) -f net6.0 -v n --settings "$(Build.Repository.LocalPath)/azure-pipelines/$(Agent.OS).runsettings"
+ testRunTitle: net6.0-$(Agent.JobName)
- bash: mono ~/.nuget/packages/xunit.runner.console/2.4.1/tools/net472/xunit.console.exe bin/MessagePack.Tests/$(BuildConfiguration)/net472/MessagePack.Tests.dll -html $(BUILD.ARTIFACTSTAGINGDIRECTORY)/build_logs/mono_testrun.html
displayName: Run MessagePack.Tests (mono)
diff --git a/azure-pipelines/install-dependencies.yml b/azure-pipelines/install-dependencies.yml
index 5b1ac4afd..7563bc1f8 100644
--- a/azure-pipelines/install-dependencies.yml
+++ b/azure-pipelines/install-dependencies.yml
@@ -7,8 +7,14 @@ steps:
$AccessToken = '$(System.AccessToken)' # Avoid specifying the access token directly on the init.ps1 command line to avoid it showing up in errors
.\init.ps1 -AccessToken $AccessToken ${{ parameters['initArgs'] }} -UpgradePrerequisites
dotnet --info
+
+ # Print mono version if it is present.
+ if (Get-Command mono -ErrorAction SilentlyContinue) {
+ mono --version
+ }
displayName: Install prerequisites
- powershell: azure-pipelines/variables/_pipelines.ps1
failOnStderr: true
displayName: Set pipeline variables based on source
+ name: SetPipelineVariables
diff --git a/azure-pipelines/release.yml b/azure-pipelines/release.yml
index 4f6ebd829..83a6ab1ab 100644
--- a/azure-pipelines/release.yml
+++ b/azure-pipelines/release.yml
@@ -21,15 +21,13 @@ stages:
runOnce:
deploy:
steps:
+ - download: none
- powershell: |
Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)"
displayName: Set pipeline name
- download: CI
artifact: unity
displayName: 'Downloading artifact: unity'
- - download: CI
- artifact: vsix
- displayName: 'Downloading artifact: vsix'
- task: GitHubRelease@1
displayName: GitHub release (create)
inputs:
@@ -41,7 +39,6 @@ stages:
title: v$(resources.pipeline.CI.runName)
assets: |
$(Pipeline.Workspace)/CI/unity/*.unitypackage
- $(Pipeline.Workspace)/CI/vsix/*
isDraft: true # After running this step, visit the new draft release, edit, and publish.
changeLogCompareToRelease: lastNonDraftRelease
changeLogType: issueBased
diff --git a/azure-pipelines/variables/_pipelines.ps1 b/azure-pipelines/variables/_pipelines.ps1
index 14d6ffc28..867b7fc8b 100644
--- a/azure-pipelines/variables/_pipelines.ps1
+++ b/azure-pipelines/variables/_pipelines.ps1
@@ -8,13 +8,16 @@
# Always use ALL CAPS for env var names since Azure Pipelines converts variable names to all caps and on non-Windows OS, env vars are case sensitive.
$keyCaps = $_.Key.ToUpper()
if (Test-Path -Path "env:$keyCaps") {
- Write-Host "Skipping setting $keyCaps because variable is already set." -ForegroundColor Cyan
+ Write-Host "Skipping setting $keyCaps because variable is already set to '$(Get-Content env:$keyCaps)'." -ForegroundColor Cyan
} else {
Write-Host "$keyCaps=$($_.Value)" -ForegroundColor Yellow
if ($env:TF_BUILD) {
- Write-Host "##vso[task.setvariable variable=$keyCaps;]$($_.Value)"
+ # Create two variables: the first that can be used by its simple name and accessible only within this job.
+ Write-Host "##vso[task.setvariable variable=$keyCaps]$($_.Value)"
+ # and the second that works across jobs and stages but must be fully qualified when referenced.
+ Write-Host "##vso[task.setvariable variable=$keyCaps;isOutput=true]$($_.Value)"
} elseif ($env:GITHUB_ACTIONS) {
- Write-Host "::set-env name=$keyCaps::$($_.Value)"
+ Add-Content -Path $env:GITHUB_ENV -Value "$keyCaps=$($_.Value)"
}
Set-Item -Path "env:$keyCaps" -Value $_.Value
}
diff --git a/benchmark/ExperimentalBenchmark/ExperimentalBenchmark.csproj b/benchmark/ExperimentalBenchmark/ExperimentalBenchmark.csproj
index fb222f26c..dbefafaf4 100644
--- a/benchmark/ExperimentalBenchmark/ExperimentalBenchmark.csproj
+++ b/benchmark/ExperimentalBenchmark/ExperimentalBenchmark.csproj
@@ -6,6 +6,7 @@
BenchmarktrueTrue
+ $(NoWarn);MSB3243
diff --git a/benchmark/SerializerBenchmark/BenchmarkConfig.cs b/benchmark/SerializerBenchmark/BenchmarkConfig.cs
index c641d7315..e6e7066c4 100644
--- a/benchmark/SerializerBenchmark/BenchmarkConfig.cs
+++ b/benchmark/SerializerBenchmark/BenchmarkConfig.cs
@@ -27,13 +27,13 @@ public BenchmarkConfig()
Job baseConfig = Job.ShortRun.WithIterationCount(1).WithWarmupCount(1);
// Add(baseConfig.With(Runtime.Clr).With(Jit.RyuJit).With(Platform.X64));
- this.Add(baseConfig.With(CoreRuntime.Core31).With(Jit.RyuJit).With(Platform.X64));
+ this.AddJob(baseConfig.WithRuntime(CoreRuntime.Core31).WithJit(Jit.RyuJit).WithPlatform(Platform.X64));
- this.Add(MarkdownExporter.GitHub);
- this.Add(CsvExporter.Default);
- this.Add(MemoryDiagnoser.Default);
+ this.AddExporter(MarkdownExporter.GitHub);
+ this.AddExporter(CsvExporter.Default);
+ this.AddDiagnoser(MemoryDiagnoser.Default);
- this.Add(new DataSizeColumn());
+ this.AddColumn(new DataSizeColumn());
this.Orderer = new CustomOrderer();
}
@@ -96,19 +96,24 @@ public string GetValue(Summary summary, BenchmarkCase benchmarkCase)
public string GetValue(Summary summary, BenchmarkCase benchmarkCase, SummaryStyle style)
{
System.Reflection.MethodInfo mi = benchmarkCase.Descriptor.WorkloadMethod;
- if (mi.Name.Contains("Serialize"))
+ if (!mi.Name.Contains("Serialize"))
{
- var instance = Activator.CreateInstance(mi.DeclaringType);
- mi.DeclaringType.GetField("Serializer").SetValue(instance, benchmarkCase.Parameters[0].Value);
- mi.DeclaringType.GetMethod("Setup").Invoke(instance, null);
-
- var bytes = (byte[])mi.Invoke(instance, null);
- return ToHumanReadableSize(bytes.Length);
+ return "-";
}
- else
+
+ var instance = Activator.CreateInstance(mi.DeclaringType);
+ mi.DeclaringType.GetField("Serializer").SetValue(instance, benchmarkCase.Parameters[0].Value);
+ mi.DeclaringType.GetMethod("Setup").Invoke(instance, null);
+
+ var bytes = (byte[])mi.Invoke(instance, null);
+ var byteSize = bytes.Length;
+ var cultureInfo = summary.GetCultureInfo();
+ if (style.PrintUnitsInContent)
{
- return "-";
+ return SizeValue.FromBytes(byteSize).ToString(style.SizeUnit, cultureInfo);
}
+
+ return byteSize.ToString("0.##", cultureInfo);
}
public bool IsAvailable(Summary summary)
@@ -120,65 +125,6 @@ public bool IsDefault(Summary summary, BenchmarkCase benchmarkCase)
{
return false;
}
-
- private static string ToHumanReadableSize(long size)
- {
- return ToHumanReadableSize(new long?(size));
- }
-
- private static string ToHumanReadableSize(long? size)
- {
- if (size == null)
- {
- return "NULL";
- }
-
- double bytes = size.Value;
-
- if (bytes <= 1024)
- {
- return bytes.ToString("f2") + " B";
- }
-
- bytes = bytes / 1024;
- if (bytes <= 1024)
- {
- return bytes.ToString("f2") + " KB";
- }
-
- bytes = bytes / 1024;
- if (bytes <= 1024)
- {
- return bytes.ToString("f2") + " MB";
- }
-
- bytes = bytes / 1024;
- if (bytes <= 1024)
- {
- return bytes.ToString("f2") + " GB";
- }
-
- bytes = bytes / 1024;
- if (bytes <= 1024)
- {
- return bytes.ToString("f2") + " TB";
- }
-
- bytes = bytes / 1024;
- if (bytes <= 1024)
- {
- return bytes.ToString("f2") + " PB";
- }
-
- bytes = bytes / 1024;
- if (bytes <= 1024)
- {
- return bytes.ToString("f2") + " EB";
- }
-
- bytes = bytes / 1024;
- return bytes + " ZB";
- }
}
}
}
diff --git a/benchmark/SerializerBenchmark/OdinSerializer.dll b/benchmark/SerializerBenchmark/OdinSerializer.dll
new file mode 100644
index 000000000..c46f54936
Binary files /dev/null and b/benchmark/SerializerBenchmark/OdinSerializer.dll differ
diff --git a/benchmark/SerializerBenchmark/Program.cs b/benchmark/SerializerBenchmark/Program.cs
index 8bc34aecc..c0d23073b 100644
--- a/benchmark/SerializerBenchmark/Program.cs
+++ b/benchmark/SerializerBenchmark/Program.cs
@@ -1,13 +1,11 @@
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using Benchmark;
-using Benchmark.Models;
using BenchmarkDotNet.Running;
-namespace ConsoleApp1
+namespace Benchmark
{
- internal class Program
+ internal static class Program
{
private static void Main(string[] args)
{
diff --git a/benchmark/SerializerBenchmark/SerializerBenchmark.cs b/benchmark/SerializerBenchmark/SerializerBenchmark.cs
index c29155384..71a95e208 100644
--- a/benchmark/SerializerBenchmark/SerializerBenchmark.cs
+++ b/benchmark/SerializerBenchmark/SerializerBenchmark.cs
@@ -21,7 +21,7 @@ public class AllSerializerBenchmark_BytesInOut
[ParamsSource(nameof(Serializers))]
public SerializerBase Serializer;
- // Currently BenchmarkdDotNet does not detect inherited ParamsSource so use copy and paste:)
+ // Currently BenchmarkDotNet does not detect inherited ParamsSource so use copy and paste:)
public IEnumerable Serializers => new SerializerBase[]
{
new MessagePack_v1(),
@@ -31,19 +31,20 @@ public class AllSerializerBenchmark_BytesInOut
new MsgPack_v2_opt(),
//new MsgPack_v2_string(),
//new MsgPack_v2_str_lz4(),
- new ProtobufNet(),
- new JsonNet(),
- new BsonNet(),
- new BinaryFormatter_(),
- new DataContract_(),
- new Hyperion_(),
- new Jil_(),
- new SpanJson_(),
- new Utf8Json_(),
- new SystemTextJson(),
- new MsgPackCli(),
- new FsPickler_(),
- new Ceras_(),
+ new ProtobufNetSerializer(),
+ new JsonNetSerializer(),
+ new BsonNetSerializer(),
+ new BinaryFormatterSerializer(),
+ new DataContractSerializer(),
+ new HyperionSerializer(),
+ new JilSerializer(),
+ new SpanJsonSerializer(),
+ new Utf8JsonSerializer(),
+ new SystemTextJsonSerializer(),
+ new MsgPackCliSerializer(),
+ new FsPicklerSerializer(),
+ new CerasSerializer(),
+ new OdinSerializer_(),
};
protected static readonly ExpressionTreeFixture ExpressionTreeFixture = new ExpressionTreeFixture();
@@ -568,7 +569,7 @@ public class MsgPackV1_Vs_MsgPackV2_BytesInOut // : AllSerializerBenchmark
[ParamsSource(nameof(Serializers))]
public SerializerBase Serializer;
- // Currently BenchmarkdDotNet does not detect inherited ParamsSource so use copy and paste:)
+ // Currently BenchmarkDotNet does not detect inherited ParamsSource so use copy and paste:)
public IEnumerable Serializers => new SerializerBase[]
{
new MessagePack_v1(),
@@ -1099,7 +1100,7 @@ public class ShortRun_AllSerializerBenchmark_BytesInOut
private bool isContractless;
- // Currently BenchmarkdDotNet does not detect inherited ParamsSource so use copy and paste:)
+ // Currently BenchmarkDotNet does not detect inherited ParamsSource so use copy and paste:)
public IEnumerable Serializers => new SerializerBase[]
{
new MessagePack_v1(),
@@ -1111,19 +1112,20 @@ public class ShortRun_AllSerializerBenchmark_BytesInOut
new MsgPack_v2_string(),
new MsgPack_v1_str_lz4(),
new MsgPack_v2_str_lz4(),
- new ProtobufNet(),
- new JsonNet(),
- new BsonNet(),
- new BinaryFormatter_(),
- new DataContract_(),
- new Hyperion_(),
- new Jil_(),
- new SpanJson_(),
- new Utf8Json_(),
- new SystemTextJson(),
- new MsgPackCli(),
- new FsPickler_(),
- new Ceras_(),
+ new ProtobufNetSerializer(),
+ new JsonNetSerializer(),
+ new BsonNetSerializer(),
+ new BinaryFormatterSerializer(),
+ new DataContractSerializer(),
+ new HyperionSerializer(),
+ new JilSerializer(),
+ new SpanJsonSerializer(),
+ new Utf8JsonSerializer(),
+ new SystemTextJsonSerializer(),
+ new MsgPackCliSerializer(),
+ new FsPicklerSerializer(),
+ new CerasSerializer(),
+ new OdinSerializer_(),
};
protected static readonly ExpressionTreeFixture ExpressionTreeFixture = new ExpressionTreeFixture();
@@ -1197,7 +1199,7 @@ public class ShortRun_MsgPackV1_Vs_MsgPackV2_BytesInOut
[ParamsSource(nameof(Serializers))]
public SerializerBase Serializer;
- // Currently BenchmarkdDotNet does not detect inherited ParamsSource so use copy and paste:)
+ // Currently BenchmarkDotNet does not detect inherited ParamsSource so use copy and paste:)
public IEnumerable Serializers => new SerializerBase[]
{
new MessagePack_v1(),
diff --git a/benchmark/SerializerBenchmark/SerializerBenchmark.csproj b/benchmark/SerializerBenchmark/SerializerBenchmark.csproj
index b4912cc86..b6be2ea09 100644
--- a/benchmark/SerializerBenchmark/SerializerBenchmark.csproj
+++ b/benchmark/SerializerBenchmark/SerializerBenchmark.csproj
@@ -10,7 +10,7 @@
-
+
@@ -20,7 +20,7 @@
-
+
@@ -40,6 +40,7 @@
truefalse
-
+
+
diff --git a/benchmark/SerializerBenchmark/Serializers/BinaryFormatter.cs b/benchmark/SerializerBenchmark/Serializers/BinaryFormatter.cs
deleted file mode 100644
index b3981a890..000000000
--- a/benchmark/SerializerBenchmark/Serializers/BinaryFormatter.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) All contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.IO;
-using System.Runtime.Serialization.Formatters.Binary;
-using Benchmark.Serializers;
-
-#pragma warning disable SA1649 // File name should match first type name
-
-public class BinaryFormatter_ : SerializerBase
-{
- public override T Deserialize(object input)
- {
- using (var ms = new MemoryStream((byte[])input))
- {
- return (T)new BinaryFormatter().Deserialize(ms);
- }
- }
-
- public override object Serialize(T input)
- {
- using (var ms = new MemoryStream())
- {
- new BinaryFormatter().Serialize(ms, input);
- ms.Flush();
- return ms.ToArray();
- }
- }
-}
diff --git a/benchmark/SerializerBenchmark/Serializers/BinaryFormatterSerializer.cs b/benchmark/SerializerBenchmark/Serializers/BinaryFormatterSerializer.cs
new file mode 100644
index 000000000..c54b5487f
--- /dev/null
+++ b/benchmark/SerializerBenchmark/Serializers/BinaryFormatterSerializer.cs
@@ -0,0 +1,34 @@
+// Copyright (c) All contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
+
+namespace Benchmark.Serializers
+{
+ public class BinaryFormatterSerializer : SerializerBase
+ {
+ public override T Deserialize(object input)
+ {
+ using (var ms = new MemoryStream((byte[])input))
+ {
+ return (T)new BinaryFormatter().Deserialize(ms);
+ }
+ }
+
+ public override object Serialize(T input)
+ {
+ using (var ms = new MemoryStream())
+ {
+ new BinaryFormatter().Serialize(ms, input);
+ ms.Flush();
+ return ms.ToArray();
+ }
+ }
+
+ public override string ToString()
+ {
+ return "BinaryFormatter";
+ }
+ }
+}
diff --git a/benchmark/SerializerBenchmark/Serializers/BsonNetSerializer.cs b/benchmark/SerializerBenchmark/Serializers/BsonNetSerializer.cs
index cd379a0fe..68616af44 100644
--- a/benchmark/SerializerBenchmark/Serializers/BsonNetSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/BsonNetSerializer.cs
@@ -2,42 +2,47 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
-using Benchmark.Serializers;
using Newtonsoft.Json;
using Newtonsoft.Json.Bson;
-#pragma warning disable SA1649 // File name should match first type name
-
-public class BsonNet : SerializerBase
+namespace Benchmark.Serializers
{
- private static readonly JsonSerializer Serializer = new JsonSerializer();
-
- public override T Deserialize(object input)
+ public class BsonNetSerializer : SerializerBase
{
- using (var ms = new MemoryStream((byte[])input))
- using (var jr = new BsonDataReader(ms))
- {
- return Serializer.Deserialize(jr);
- }
- }
+ private static readonly JsonSerializer Serializer = new JsonSerializer();
- public override object Serialize(T input)
- {
- object value = input;
- if (typeof(T).IsValueType)
+ public override T Deserialize(object input)
{
- value = new[] { input };
+ using (var ms = new MemoryStream((byte[])input))
+ using (var jr = new BsonDataReader(ms))
+ {
+ return Serializer.Deserialize(jr);
+ }
}
- using (var ms = new MemoryStream())
+ public override object Serialize(T input)
{
- using (var jw = new BsonDataWriter(ms))
+ object value = input;
+ if (typeof(T).IsValueType)
{
- Serializer.Serialize(jw, value);
+ value = new[] { input };
}
- ms.Flush();
- return ms.ToArray();
+ using (var ms = new MemoryStream())
+ {
+ using (var jw = new BsonDataWriter(ms))
+ {
+ Serializer.Serialize(jw, value);
+ }
+
+ ms.Flush();
+ return ms.ToArray();
+ }
+ }
+
+ public override string ToString()
+ {
+ return "BsonNet";
}
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/CerasSerializer.cs b/benchmark/SerializerBenchmark/Serializers/CerasSerializer.cs
index cfdd9be09..9521e4f2b 100644
--- a/benchmark/SerializerBenchmark/Serializers/CerasSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/CerasSerializer.cs
@@ -1,21 +1,25 @@
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using Benchmark.Serializers;
-
-#pragma warning disable SA1649 // File name should match first type name
-
-public class Ceras_ : SerializerBase
+namespace Benchmark.Serializers
{
- private Ceras.CerasSerializer ceras = new Ceras.CerasSerializer();
-
- public override T Deserialize(object input)
+ public class CerasSerializer : SerializerBase
{
- return this.ceras.Deserialize((byte[])input);
- }
+ private Ceras.CerasSerializer ceras = new Ceras.CerasSerializer();
- public override object Serialize(T input)
- {
- return this.ceras.Serialize(input);
+ public override T Deserialize(object input)
+ {
+ return this.ceras.Deserialize((byte[])input);
+ }
+
+ public override object Serialize(T input)
+ {
+ return this.ceras.Serialize(input);
+ }
+
+ public override string ToString()
+ {
+ return "Ceras";
+ }
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/DataContractSerializer.cs b/benchmark/SerializerBenchmark/Serializers/DataContractSerializer.cs
index eae1431ff..4425ed0e2 100644
--- a/benchmark/SerializerBenchmark/Serializers/DataContractSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/DataContractSerializer.cs
@@ -2,28 +2,32 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
-using System.Runtime.Serialization;
-using Benchmark.Serializers;
-#pragma warning disable SA1649 // File name should match first type name
-
-public class DataContract_ : SerializerBase
+namespace Benchmark.Serializers
{
- public override T Deserialize(object input)
+ public class DataContractSerializer : SerializerBase
{
- using (var ms = new MemoryStream((byte[])input))
+ public override T Deserialize(object input)
{
- return (T)new DataContractSerializer(typeof(T)).ReadObject(ms);
+ using (var ms = new MemoryStream((byte[])input))
+ {
+ return (T)new System.Runtime.Serialization.DataContractSerializer(typeof(T)).ReadObject(ms);
+ }
}
- }
- public override object Serialize(T input)
- {
- using (var ms = new MemoryStream())
+ public override object Serialize(T input)
+ {
+ using (var ms = new MemoryStream())
+ {
+ new System.Runtime.Serialization.DataContractSerializer(typeof(T)).WriteObject(ms, input);
+ ms.Flush();
+ return ms.ToArray();
+ }
+ }
+
+ public override string ToString()
{
- new DataContractSerializer(typeof(T)).WriteObject(ms, input);
- ms.Flush();
- return ms.ToArray();
+ return "DataContract";
}
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/FsPicklerSerializer.cs b/benchmark/SerializerBenchmark/Serializers/FsPicklerSerializer.cs
index 18b1c88e8..d0c8341fe 100644
--- a/benchmark/SerializerBenchmark/Serializers/FsPicklerSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/FsPicklerSerializer.cs
@@ -2,30 +2,35 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
-using Benchmark.Serializers;
using MBrace.FsPickler;
-#pragma warning disable SA1649 // File name should match first type name
-
-public class FsPickler_ : SerializerBase
+namespace Benchmark.Serializers
{
- private static readonly BinarySerializer Serializer = MBrace.FsPickler.FsPickler.CreateBinarySerializer();
-
- public override T Deserialize(object input)
+ public class FsPicklerSerializer : SerializerBase
{
- using (var ms = new MemoryStream((byte[])input))
+ private static readonly BinarySerializer Serializer = MBrace.FsPickler.FsPickler.CreateBinarySerializer();
+
+ public override T Deserialize(object input)
{
- return Serializer.Deserialize(ms);
+ using (var ms = new MemoryStream((byte[])input))
+ {
+ return Serializer.Deserialize(ms);
+ }
}
- }
- public override object Serialize(T input)
- {
- using (var ms = new MemoryStream())
+ public override object Serialize(T input)
+ {
+ using (var ms = new MemoryStream())
+ {
+ Serializer.Serialize(ms, input);
+ ms.Flush();
+ return ms.ToArray();
+ }
+ }
+
+ public override string ToString()
{
- Serializer.Serialize(ms, input);
- ms.Flush();
- return ms.ToArray();
+ return "FsPickler";
}
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/HyperionSerializer.cs b/benchmark/SerializerBenchmark/Serializers/HyperionSerializer.cs
index b38ef9494..0f5d5d847 100644
--- a/benchmark/SerializerBenchmark/Serializers/HyperionSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/HyperionSerializer.cs
@@ -2,30 +2,35 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
-using Benchmark.Serializers;
using Hyperion;
-#pragma warning disable SA1649 // File name should match first type name
-
-public class Hyperion_ : SerializerBase
+namespace Benchmark.Serializers
{
- private static readonly Serializer Serializer = new Hyperion.Serializer();
-
- public override T Deserialize(object input)
+ public class HyperionSerializer : SerializerBase
{
- using (var ms = new MemoryStream((byte[])input))
+ private static readonly Serializer Serializer = new Hyperion.Serializer();
+
+ public override T Deserialize(object input)
{
- return Serializer.Deserialize(ms);
+ using (var ms = new MemoryStream((byte[])input))
+ {
+ return Serializer.Deserialize(ms);
+ }
}
- }
- public override object Serialize(T input)
- {
- using (var ms = new MemoryStream())
+ public override object Serialize(T input)
+ {
+ using (var ms = new MemoryStream())
+ {
+ Serializer.Serialize(input, ms);
+ ms.Flush();
+ return ms.ToArray();
+ }
+ }
+
+ public override string ToString()
{
- Serializer.Serialize(input, ms);
- ms.Flush();
- return ms.ToArray();
+ return "Hyperion";
}
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/JilSerializer.cs b/benchmark/SerializerBenchmark/Serializers/JilSerializer.cs
index b68a0585f..983e07d3e 100644
--- a/benchmark/SerializerBenchmark/Serializers/JilSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/JilSerializer.cs
@@ -2,20 +2,25 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Text;
-using Benchmark.Serializers;
using Jil;
-#pragma warning disable SA1649 // File name should match first type name
-
-public class Jil_ : SerializerBase
+namespace Benchmark.Serializers
{
- public override object Serialize(T input)
+ public class JilSerializer : SerializerBase
{
- return Encoding.UTF8.GetBytes(Jil.JSON.Serialize(input, Options.ISO8601));
- }
+ public override object Serialize(T input)
+ {
+ return Encoding.UTF8.GetBytes(Jil.JSON.Serialize(input, Options.ISO8601));
+ }
- public override T Deserialize(object input)
- {
- return Jil.JSON.Deserialize(Encoding.UTF8.GetString((byte[])input), Options.ISO8601);
+ public override T Deserialize(object input)
+ {
+ return Jil.JSON.Deserialize(Encoding.UTF8.GetString((byte[])input), Options.ISO8601);
+ }
+
+ public override string ToString()
+ {
+ return "Jil";
+ }
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/JsonNetSerializer.cs b/benchmark/SerializerBenchmark/Serializers/JsonNetSerializer.cs
index 80761c6a4..b85574ddc 100644
--- a/benchmark/SerializerBenchmark/Serializers/JsonNetSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/JsonNetSerializer.cs
@@ -3,37 +3,42 @@
using System.IO;
using System.Text;
-using Benchmark.Serializers;
using Newtonsoft.Json;
-#pragma warning disable SA1649 // File name should match first type name
-
-public class JsonNet : SerializerBase
+namespace Benchmark.Serializers
{
- private static readonly JsonSerializer Serializer = new JsonSerializer();
-
- public override T Deserialize(object input)
+ public class JsonNetSerializer : SerializerBase
{
- using (var ms = new MemoryStream((byte[])input))
- using (var sr = new StreamReader(ms, Encoding.UTF8))
- using (var jr = new JsonTextReader(sr))
+ private static readonly JsonSerializer Serializer = new JsonSerializer();
+
+ public override T Deserialize(object input)
{
- return Serializer.Deserialize(jr);
+ using (var ms = new MemoryStream((byte[])input))
+ using (var sr = new StreamReader(ms, Encoding.UTF8))
+ using (var jr = new JsonTextReader(sr))
+ {
+ return Serializer.Deserialize(jr);
+ }
}
- }
- public override object Serialize(T input)
- {
- using (var ms = new MemoryStream())
+ public override object Serialize(T input)
{
- using (var sw = new StreamWriter(ms, Encoding.UTF8))
- using (var jw = new JsonTextWriter(sw))
+ using (var ms = new MemoryStream())
{
- Serializer.Serialize(jw, input);
+ using (var sw = new StreamWriter(ms, Encoding.UTF8))
+ using (var jw = new JsonTextWriter(sw))
+ {
+ Serializer.Serialize(jw, input);
+ }
+
+ ms.Flush();
+ return ms.ToArray();
}
+ }
- ms.Flush();
- return ms.ToArray();
+ public override string ToString()
+ {
+ return "JsonNet";
}
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/MessagePackSerializer.cs b/benchmark/SerializerBenchmark/Serializers/MessagePackSerializer.cs
index eb5901c9f..7583e0361 100644
--- a/benchmark/SerializerBenchmark/Serializers/MessagePackSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/MessagePackSerializer.cs
@@ -4,172 +4,221 @@
extern alias oldmsgpack;
extern alias newmsgpack;
-using Benchmark.Serializers;
-
#pragma warning disable SA1649 // File name should match first type name
-public class MessagePack_v1 : SerializerBase
+namespace Benchmark.Serializers
{
- public override T Deserialize(object input)
+ public class MessagePack_v1 : SerializerBase
{
- return oldmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input);
- }
+ public override T Deserialize(object input)
+ {
+ return oldmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input);
+ }
- public override object Serialize(T input)
- {
- return oldmsgpack::MessagePack.MessagePackSerializer.Serialize(input);
- }
-}
+ public override object Serialize(T input)
+ {
+ return oldmsgpack::MessagePack.MessagePackSerializer.Serialize(input);
+ }
-public class MessagePack_v2 : SerializerBase
-{
- public override T Deserialize(object input)
- {
- return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input);
+ public override string ToString()
+ {
+ return "MessagePack_v1";
+ }
}
- public override object Serialize(T input)
+ public class MessagePack_v2 : SerializerBase
{
- return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input);
- }
-}
+ public override T Deserialize(object input)
+ {
+ return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input);
+ }
-public class MsgPack_v1_string : SerializerBase
-{
- public override T Deserialize(object input)
- {
- return oldmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance);
+ public override object Serialize(T input)
+ {
+ return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input);
+ }
+
+ public override string ToString()
+ {
+ return "MessagePack_v2";
+ }
}
- public override object Serialize(T input)
+ public class MsgPack_v1_string : SerializerBase
{
- return oldmsgpack::MessagePack.MessagePackSerializer.Serialize(input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance);
- }
-}
+ public override T Deserialize(object input)
+ {
+ return oldmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance);
+ }
-public class MsgPack_v2_string : SerializerBase
-{
- private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options = newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithResolver(newmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance);
+ public override object Serialize(T input)
+ {
+ return oldmsgpack::MessagePack.MessagePackSerializer.Serialize(input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance);
+ }
- public override T Deserialize(object input)
- {
- return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, options: Options);
+ public override string ToString()
+ {
+ return "MsgPack_v1_string";
+ }
}
- public override object Serialize(T input)
+ public class MsgPack_v2_string : SerializerBase
{
- return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, options: Options);
- }
-}
+ private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options =
+ newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithResolver(newmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance);
-public class MessagePackLz4_v1 : SerializerBase
-{
- public override T Deserialize(object input)
- {
- return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Deserialize((byte[])input);
+ public override T Deserialize(object input)
+ {
+ return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, options: Options);
+ }
+
+ public override object Serialize(T input)
+ {
+ return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, options: Options);
+ }
+
+ public override string ToString()
+ {
+ return "MsgPack_v2_string";
+ }
}
- public override object Serialize(T input)
+ public class MessagePackLz4_v1 : SerializerBase
{
- return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Serialize(input);
- }
-}
+ public override T Deserialize(object input)
+ {
+ return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Deserialize((byte[])input);
+ }
-public class MessagePackLz4_v2 : SerializerBase
-{
- private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions LZ4BlockArray = newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithCompression(newmsgpack::MessagePack.MessagePackCompression.Lz4BlockArray);
+ public override object Serialize(T input)
+ {
+ return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Serialize(input);
+ }
- public override T Deserialize(object input)
- {
- return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, LZ4BlockArray);
+ public override string ToString()
+ {
+ return "MessagePackLz4_v1";
+ }
}
- public override object Serialize(T input)
+ public class MessagePackLz4_v2 : SerializerBase
{
- return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, LZ4BlockArray);
- }
-}
+ private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions LZ4BlockArray =
+ newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithCompression(newmsgpack::MessagePack.MessagePackCompression.Lz4BlockArray);
-public class MsgPack_v1_str_lz4 : SerializerBase
-{
- public override T Deserialize(object input)
- {
- return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Deserialize((byte[])input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance);
+ public override T Deserialize(object input)
+ {
+ return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, LZ4BlockArray);
+ }
+
+ public override object Serialize(T input)
+ {
+ return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, LZ4BlockArray);
+ }
+
+ public override string ToString()
+ {
+ return "MessagePackLz4_v2";
+ }
}
- public override object Serialize(T input)
+ public class MsgPack_v1_str_lz4 : SerializerBase
{
- return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Serialize(input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance);
- }
-}
+ public override T Deserialize(object input)
+ {
+ return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Deserialize((byte[])input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance);
+ }
-public class MsgPack_v2_str_lz4 : SerializerBase
-{
- private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options = newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithResolver(newmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance).WithCompression(newmsgpack::MessagePack.MessagePackCompression.Lz4BlockArray);
+ public override object Serialize(T input)
+ {
+ return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Serialize(input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance);
+ }
- public override T Deserialize(object input)
- {
- return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, Options);
+ public override string ToString()
+ {
+ return "MsgPack_v1_str_lz4";
+ }
}
- public override object Serialize(T input)
+ public class MsgPack_v2_str_lz4 : SerializerBase
{
- return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, Options);
- }
-}
+ private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options = newmsgpack::MessagePack.MessagePackSerializerOptions.Standard
+ .WithResolver(newmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance)
+ .WithCompression(newmsgpack::MessagePack.MessagePackCompression.Lz4BlockArray);
-public class MsgPack_v2_opt : SerializerBase
-{
- private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options = newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithResolver(OptimizedResolver.Instance);
+ public override T Deserialize(object input)
+ {
+ return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, Options);
+ }
- public override T Deserialize(object input)
- {
- return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, Options);
+ public override object Serialize(T input)
+ {
+ return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, Options);
+ }
+
+ public override string ToString()
+ {
+ return "MsgPack_v2_str_lz4";
+ }
}
- public override object Serialize(T input)
+ public class MsgPack_v2_opt : SerializerBase
{
- return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, Options);
- }
-}
+ private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options =
+ newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithResolver(OptimizedResolver.Instance);
-public class OptimizedResolver : newmsgpack::MessagePack.IFormatterResolver
-{
- public static readonly newmsgpack::MessagePack.IFormatterResolver Instance = new OptimizedResolver();
+ public override T Deserialize(object input)
+ {
+ return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, Options);
+ }
- // configure your custom resolvers.
- private static readonly newmsgpack::MessagePack.IFormatterResolver[] Resolvers = new newmsgpack::MessagePack.IFormatterResolver[]
- {
- newmsgpack::MessagePack.Resolvers.NativeGuidResolver.Instance,
- newmsgpack::MessagePack.Resolvers.NativeDecimalResolver.Instance,
- newmsgpack::MessagePack.Resolvers.NativeDateTimeResolver.Instance,
- newmsgpack::MessagePack.Resolvers.StandardResolver.Instance,
- };
+ public override object Serialize(T input)
+ {
+ return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, Options);
+ }
- private OptimizedResolver()
- {
+ public override string ToString()
+ {
+ return "MsgPack_v2_opt";
+ }
}
- public newmsgpack::MessagePack.Formatters.IMessagePackFormatter GetFormatter()
+ public class OptimizedResolver : newmsgpack::MessagePack.IFormatterResolver
{
- return Cache.Formatter;
- }
+ public static readonly newmsgpack::MessagePack.IFormatterResolver Instance = new OptimizedResolver();
- private static class Cache
- {
-#pragma warning disable SA1401 // Fields should be private
- public static newmsgpack::MessagePack.Formatters.IMessagePackFormatter Formatter;
-#pragma warning restore SA1401 // Fields should be private
+ // configure your custom resolvers.
+ private static readonly newmsgpack::MessagePack.IFormatterResolver[] Resolvers = new newmsgpack::MessagePack.IFormatterResolver[]
+ {
+ newmsgpack::MessagePack.Resolvers.NativeGuidResolver.Instance, newmsgpack::MessagePack.Resolvers.NativeDecimalResolver.Instance,
+ newmsgpack::MessagePack.Resolvers.NativeDateTimeResolver.Instance, newmsgpack::MessagePack.Resolvers.StandardResolver.Instance,
+ };
- static Cache()
+ private OptimizedResolver()
{
- foreach (var resolver in Resolvers)
+ }
+
+ public newmsgpack::MessagePack.Formatters.IMessagePackFormatter GetFormatter()
+ {
+ return Cache.Formatter;
+ }
+
+ private static class Cache
+ {
+ #pragma warning disable SA1401 // Fields should be private
+ public static newmsgpack::MessagePack.Formatters.IMessagePackFormatter Formatter;
+ #pragma warning restore SA1401 // Fields should be private
+
+ static Cache()
{
- var f = resolver.GetFormatter();
- if (f != null)
+ foreach (var resolver in Resolvers)
{
- Formatter = f;
- return;
+ var f = resolver.GetFormatter();
+ if (f != null)
+ {
+ Formatter = f;
+ return;
+ }
}
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/MsgPackCliSerializer.cs b/benchmark/SerializerBenchmark/Serializers/MsgPackCliSerializer.cs
index a03127ae6..f3238d556 100644
--- a/benchmark/SerializerBenchmark/Serializers/MsgPackCliSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/MsgPackCliSerializer.cs
@@ -1,19 +1,23 @@
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using Benchmark.Serializers;
-
-#pragma warning disable SA1649 // File name should match first type name
-
-public class MsgPackCli : SerializerBase
+namespace Benchmark.Serializers
{
- public override T Deserialize(object input)
+ public class MsgPackCliSerializer : SerializerBase
{
- return MsgPack.Serialization.MessagePackSerializer.Get().UnpackSingleObject((byte[])input);
- }
+ public override T Deserialize(object input)
+ {
+ return MsgPack.Serialization.MessagePackSerializer.Get().UnpackSingleObject((byte[])input);
+ }
- public override object Serialize(T input)
- {
- return MsgPack.Serialization.MessagePackSerializer.Get().PackSingleObject(input);
+ public override object Serialize(T input)
+ {
+ return MsgPack.Serialization.MessagePackSerializer.Get().PackSingleObject(input);
+ }
+
+ public override string ToString()
+ {
+ return "MsgPackCli";
+ }
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/OdinSerializer.cs b/benchmark/SerializerBenchmark/Serializers/OdinSerializer.cs
new file mode 100644
index 000000000..b35de1af1
--- /dev/null
+++ b/benchmark/SerializerBenchmark/Serializers/OdinSerializer.cs
@@ -0,0 +1,29 @@
+// Copyright (c) All contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Benchmark.Serializers;
+using OdinSerializer;
+using OdinSerializer.Utilities;
+
+#pragma warning disable SA1649 // File name should match first type name
+
+public class OdinSerializer_ : SerializerBase
+{
+ public override object Serialize(T input)
+ {
+ using (var ctx = Cache.Claim())
+ {
+ ctx.Value.Config.SerializationPolicy = SerializationPolicies.Everything;
+ return SerializationUtility.SerializeValue(input, DataFormat.Binary, ctx.Value);
+ }
+ }
+
+ public override T Deserialize(object input)
+ {
+ using (var ctx = Cache.Claim())
+ {
+ ctx.Value.Config.SerializationPolicy = SerializationPolicies.Everything;
+ return SerializationUtility.DeserializeValue((byte[])input, DataFormat.Binary, ctx.Value);
+ }
+ }
+}
diff --git a/benchmark/SerializerBenchmark/Serializers/ProtobufNetSerializer.cs b/benchmark/SerializerBenchmark/Serializers/ProtobufNetSerializer.cs
new file mode 100644
index 000000000..7b44b5a75
--- /dev/null
+++ b/benchmark/SerializerBenchmark/Serializers/ProtobufNetSerializer.cs
@@ -0,0 +1,33 @@
+// Copyright (c) All contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.IO;
+using ProtoBuf;
+
+namespace Benchmark.Serializers
+{
+ public class ProtobufNetSerializer : SerializerBase
+ {
+ public override T Deserialize(object input)
+ {
+ using (var ms = new MemoryStream((byte[])input))
+ {
+ return Serializer.Deserialize(ms);
+ }
+ }
+
+ public override object Serialize(T input)
+ {
+ using (var ms = new MemoryStream())
+ {
+ Serializer.Serialize(ms, input);
+ return ms.ToArray();
+ }
+ }
+
+ public override string ToString()
+ {
+ return "ProtobufNet";
+ }
+ }
+}
diff --git a/benchmark/SerializerBenchmark/Serializers/ProtobufSerializer.cs b/benchmark/SerializerBenchmark/Serializers/ProtobufSerializer.cs
deleted file mode 100644
index d0394065d..000000000
--- a/benchmark/SerializerBenchmark/Serializers/ProtobufSerializer.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) All contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.IO;
-using Benchmark.Serializers;
-using ProtoBuf;
-
-public class
-#pragma warning disable SA1649 // File name should match first type name
-
-ProtobufNet : SerializerBase
-{
- public override T Deserialize(object input)
- {
- using (var ms = new MemoryStream((byte[])input))
- {
- return Serializer.Deserialize(ms);
- }
- }
-
- public override object Serialize(T input)
- {
- using (var ms = new MemoryStream())
- {
- Serializer.Serialize(ms, input);
- return ms.ToArray();
- }
- }
-}
diff --git a/benchmark/SerializerBenchmark/Serializers/SpanJsonSerializer.cs b/benchmark/SerializerBenchmark/Serializers/SpanJsonSerializer.cs
index a3a2f44d7..33ccbd998 100644
--- a/benchmark/SerializerBenchmark/Serializers/SpanJsonSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/SpanJsonSerializer.cs
@@ -1,19 +1,23 @@
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using Benchmark.Serializers;
-
-#pragma warning disable SA1649 // File name should match first type name
-
-public class SpanJson_ : SerializerBase
+namespace Benchmark.Serializers
{
- public override object Serialize(T input)
+ public class SpanJsonSerializer : SerializerBase
{
- return SpanJson.JsonSerializer.Generic.Utf8.Serialize(input);
- }
+ public override object Serialize(T input)
+ {
+ return SpanJson.JsonSerializer.Generic.Utf8.Serialize(input);
+ }
- public override T Deserialize(object input)
- {
- return SpanJson.JsonSerializer.Generic.Utf8.Deserialize((byte[])input);
+ public override T Deserialize(object input)
+ {
+ return SpanJson.JsonSerializer.Generic.Utf8.Deserialize((byte[])input);
+ }
+
+ public override string ToString()
+ {
+ return "SpanJson";
+ }
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/SystemTextJsonSerializer.cs b/benchmark/SerializerBenchmark/Serializers/SystemTextJsonSerializer.cs
index f6358d154..baf143f99 100644
--- a/benchmark/SerializerBenchmark/Serializers/SystemTextJsonSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/SystemTextJsonSerializer.cs
@@ -1,20 +1,24 @@
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using Benchmark.Serializers;
-
-#pragma warning disable SA1649 // File name should match first type name
-
-public class SystemTextJson : SerializerBase
+namespace Benchmark.Serializers
{
- public override object Serialize(T input)
+ public class SystemTextJsonSerializer : SerializerBase
{
- return System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(input);
- }
+ public override object Serialize(T input)
+ {
+ return System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(input);
+ }
- public override T Deserialize(object input)
- {
- var span = (byte[])input;
- return System.Text.Json.JsonSerializer.Deserialize(span);
+ public override T Deserialize(object input)
+ {
+ var span = (byte[])input;
+ return System.Text.Json.JsonSerializer.Deserialize(span);
+ }
+
+ public override string ToString()
+ {
+ return "SystemTextJson";
+ }
}
}
diff --git a/benchmark/SerializerBenchmark/Serializers/Utf8JsonSerializer.cs b/benchmark/SerializerBenchmark/Serializers/Utf8JsonSerializer.cs
index f52b0d9b7..fec69a81a 100644
--- a/benchmark/SerializerBenchmark/Serializers/Utf8JsonSerializer.cs
+++ b/benchmark/SerializerBenchmark/Serializers/Utf8JsonSerializer.cs
@@ -1,19 +1,23 @@
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using Benchmark.Serializers;
-
-#pragma warning disable SA1649 // File name should match first type name
-
-public class Utf8Json_ : SerializerBase
+namespace Benchmark.Serializers
{
- public override object Serialize(T input)
+ public class Utf8JsonSerializer : SerializerBase
{
- return Utf8Json.JsonSerializer.Serialize(input);
- }
+ public override object Serialize(T input)
+ {
+ return Utf8Json.JsonSerializer.Serialize(input);
+ }
- public override T Deserialize(object input)
- {
- return Utf8Json.JsonSerializer.Deserialize((byte[])input);
+ public override T Deserialize(object input)
+ {
+ return Utf8Json.JsonSerializer.Deserialize((byte[])input);
+ }
+
+ public override string ToString()
+ {
+ return "UTF8Json";
+ }
}
}
diff --git a/doc/consume_ci.md b/doc/consume_ci.md
new file mode 100644
index 000000000..763f6f496
--- /dev/null
+++ b/doc/consume_ci.md
@@ -0,0 +1,17 @@
+# Testing fixes prior to release
+
+To help us test changes prior to their release to nuget.org, you can of course build from source.
+An easier approach may be to consume the built nuget packages from our CI/PR feed.
+
+Add this feed to your nuget.config file:
+
+```xml
+
+```
+
+Then you can add or update your package reference to some version recently built in our CI or PR build.
+PR builds always include a `-gCOMMITID` version suffix.
+CI builds lack this, but may include a standard pre-release identifier such as `-alpha`.
+
+If the change you seek is already merged, look for the latest version without the `-gCOMMITID` suffix.
+If the change you seek is in an open PR, navigate to the PR build to find the version of the built package (it will be the build number).
diff --git a/global.json b/global.json
index 11833de02..954a92e75 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "3.1.301",
+ "version": "6.0.300",
"rollForward": "patch",
"allowPrerelease": false
}
diff --git a/init.cmd b/init.cmd
index 970285c2f..667efabb7 100644
--- a/init.cmd
+++ b/init.cmd
@@ -1,4 +1,20 @@
@echo off
SETLOCAL
set PS1UnderCmd=1
+
+:: Get the datetime in a format that can go in a filename.
+set _my_datetime=%date%_%time%
+set _my_datetime=%_my_datetime: =_%
+set _my_datetime=%_my_datetime::=%
+set _my_datetime=%_my_datetime:/=_%
+set _my_datetime=%_my_datetime:.=_%
+set CmdEnvScriptPath=%temp%\envvarscript_%_my_datetime%.cmd
+
powershell.exe -NoProfile -NoLogo -ExecutionPolicy bypass -Command "try { & '%~dpn0.ps1' %*; exit $LASTEXITCODE } catch { write-host $_; exit 1 }"
+
+:: Set environment variables in the parent cmd.exe process.
+IF EXIST "%CmdEnvScriptPath%" (
+ ENDLOCAL
+ CALL "%CmdEnvScriptPath%"
+ DEL "%CmdEnvScriptPath%"
+)
diff --git a/init.ps1 b/init.ps1
index 72d68b5fa..e5aad5bfa 100755
--- a/init.ps1
+++ b/init.ps1
@@ -2,28 +2,31 @@
<#
.SYNOPSIS
-Installs dependencies required to build and test the projects in this repository.
+ Installs dependencies required to build and test the projects in this repository.
.DESCRIPTION
-This MAY not require elevation, as the SDK and runtimes are installed to a per-user location,
-unless the `-InstallLocality` switch is specified directing to a per-repo or per-machine location.
-See detailed help on that switch for more information.
+ This MAY not require elevation, as the SDK and runtimes are installed to a per-user location,
+ unless the `-InstallLocality` switch is specified directing to a per-repo or per-machine location.
+ See detailed help on that switch for more information.
+
+ The CmdEnvScriptPath environment variable may be optionally set to a path to a cmd shell script to be created (or appended to if it already exists) that will set the environment variables in cmd.exe that are set within the PowerShell environment.
+ This is used by init.cmd in order to reapply any new environment variables to the parent cmd.exe process that were set in the powershell child process.
.PARAMETER InstallLocality
-A value indicating whether dependencies should be installed locally to the repo or at a per-user location.
-Per-user allows sharing the installed dependencies across repositories and allows use of a shared expanded package cache.
-Visual Studio will only notice and use these SDKs/runtimes if VS is launched from the environment that runs this script.
-Per-repo allows for high isolation, allowing for a more precise recreation of the environment within an Azure Pipelines build.
-When using 'repo', environment variables are set to cause the locally installed dotnet SDK to be used.
-Per-repo can lead to file locking issues when dotnet.exe is left running as a build server and can be mitigated by running `dotnet build-server shutdown`.
-Per-machine requires elevation and will download and install all SDKs and runtimes to machine-wide locations so all applications can find it.
+ A value indicating whether dependencies should be installed locally to the repo or at a per-user location.
+ Per-user allows sharing the installed dependencies across repositories and allows use of a shared expanded package cache.
+ Visual Studio will only notice and use these SDKs/runtimes if VS is launched from the environment that runs this script.
+ Per-repo allows for high isolation, allowing for a more precise recreation of the environment within an Azure Pipelines build.
+ When using 'repo', environment variables are set to cause the locally installed dotnet SDK to be used.
+ Per-repo can lead to file locking issues when dotnet.exe is left running as a build server and can be mitigated by running `dotnet build-server shutdown`.
+ Per-machine requires elevation and will download and install all SDKs and runtimes to machine-wide locations so all applications can find it.
.PARAMETER NoPrerequisites
-Skips the installation of prerequisite software (e.g. SDKs, tools).
+ Skips the installation of prerequisite software (e.g. SDKs, tools).
.PARAMETER UpgradePrerequisites
-Takes time to install prerequisites even if they are already present in case they need to be upgraded.
-No effect if -NoPrerequisites is specified.
+ Takes time to install prerequisites even if they are already present in case they need to be upgraded.
+ No effect if -NoPrerequisites is specified.
.PARAMETER NoRestore
-Skips the package restore step.
+ Skips the package restore step.
.PARAMETER AccessToken
-An optional access token for authenticating to Azure Artifacts authenticated feeds.
+ An optional access token for authenticating to Azure Artifacts authenticated feeds.
#>
[CmdletBinding(SupportsShouldProcess=$true)]
Param (
@@ -71,7 +74,7 @@ try {
}
}
- & "$PSScriptRoot\azure-pipelines\Set-EnvVars.ps1" -Variables $EnvVars | Out-Null
+ & "$PSScriptRoot/tools/Set-EnvVars.ps1" -Variables $EnvVars | Out-Null
}
catch {
Write-Error $error[0]
diff --git a/prepare_release.ps1 b/prepare_release.ps1
new file mode 100644
index 000000000..d5dc21d6f
--- /dev/null
+++ b/prepare_release.ps1
@@ -0,0 +1,14 @@
+# Calculate the NPM package version, assuming the version change is in a new commit.
+git commit --allow-empty -m "Dummy commit" -q
+$NpmPackageVersion = (nbgv get-version -f json | ConvertFrom-Json).NpmPackageVersion
+git reset --mixed HEAD~ -q
+
+# Stamp the version into the package.json file and commit.
+pushd $PSScriptRoot/src/MessagePack.UnityClient/Assets/Scripts/MessagePack
+npm version $NpmPackageVersion --no-git-tag-version --allow-same-version
+git add package.json
+popd
+git commit -m "Stamp unity package version as $NpmPackageVersion"
+
+# Tag the release
+nbgv tag
diff --git a/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj b/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj
index 4ef220a07..0daf9da44 100644
--- a/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj
+++ b/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj
@@ -132,6 +132,9 @@
Code\DynamicUnionResolver.cs
+
+ Code\ResolverUtilities.cs
+
Code\StringEncoding.cs
@@ -140,8 +143,7 @@
-
-
-
+
+
diff --git a/sandbox/DynamicCodeDumper/Program.cs b/sandbox/DynamicCodeDumper/Program.cs
index 14f6199e9..0d74db48d 100644
--- a/sandbox/DynamicCodeDumper/Program.cs
+++ b/sandbox/DynamicCodeDumper/Program.cs
@@ -44,6 +44,7 @@ private static void Main(string[] args)
////DynamicObjectResolver.Instance.GetFormatter();
////DynamicObjectResolver.Instance.GetFormatter();
IMessagePackFormatter f = DynamicObjectResolverAllowPrivate.Instance.GetFormatter();
+ ////IMessagePackFormatter f = DynamicObjectResolver.Instance.GetFormatter();
////DynamicObjectResolver.Instance.GetFormatter();
////DynamicObjectResolver.Instance.GetFormatter();
////DynamicObjectResolver.Instance.GetFormatter();
diff --git a/sandbox/MessagePack.Internal/MessagePack.Internal.csproj b/sandbox/MessagePack.Internal/MessagePack.Internal.csproj
index d7e5caaad..283524803 100644
--- a/sandbox/MessagePack.Internal/MessagePack.Internal.csproj
+++ b/sandbox/MessagePack.Internal/MessagePack.Internal.csproj
@@ -1,7 +1,7 @@
- netcoreapp2.2
+ netcoreapp3.1$(DefineConstants);SPAN_BUILTIN;MESSAGEPACK_INTERNALtrueTrue
diff --git a/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs b/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs
index 3c0ef2f29..68af163a9 100644
--- a/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs
+++ b/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs
@@ -1,4 +1,4 @@
-// Copyright (c) All contributors. All rights reserved.
+// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias newmsgpack;
@@ -60,6 +60,12 @@ public IntKeySerializerTarget IntKey()
return newmsgpack.MessagePack.MessagePackSerializer.Deserialize(intObj);
}
+ [Benchmark]
+ public IntKeySerializerTarget IntKey_NonGeneric()
+ {
+ return (IntKeySerializerTarget)newmsgpack.MessagePack.MessagePackSerializer.Deserialize(typeof(IntKeySerializerTarget), intObj);
+ }
+
[Benchmark]
public StringKeySerializerTarget StringKey()
{
diff --git a/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs b/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs
index 0cff63343..64e7c89a3 100644
--- a/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs
+++ b/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs
@@ -4,6 +4,7 @@
extern alias newmsgpack;
extern alias oldmsgpack;
+using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using Nerdbank.Streams;
@@ -12,7 +13,7 @@ namespace PerfBenchmarkDotNet
{
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[CategoriesColumn]
- public class MessagePackWriterBenchmark
+ public class MessagePackWriterBenchmark : IDisposable
{
private const int RepsOverArray = 300 * 1024;
private readonly Sequence sequence = new Sequence();
@@ -148,5 +149,19 @@ public void WriteString()
offset = 0;
}
}
+
+ public void Dispose()
+ {
+ this.Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ this.sequence.Dispose();
+ }
+ }
}
}
diff --git a/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj b/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj
index 53bb5949d..6804253df 100644
--- a/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj
+++ b/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj
@@ -1,7 +1,7 @@
Exe
- net472;netcoreapp2.2
+ net472;net6.0truetrue
@@ -19,7 +19,7 @@
-
+
diff --git a/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs b/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs
index 0ed114b06..fc9a3a06d 100644
--- a/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs
+++ b/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs
@@ -1,4 +1,4 @@
-// Copyright (c) All contributors. All rights reserved.
+// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias newmsgpack;
@@ -35,6 +35,12 @@ public byte[] IntKey()
return newmsgpack.MessagePack.MessagePackSerializer.Serialize(intData);
}
+ [Benchmark]
+ public byte[] IntKey_NonGeneric()
+ {
+ return newmsgpack.MessagePack.MessagePackSerializer.Serialize(typeof(IntKeySerializerTarget), intData);
+ }
+
[Benchmark]
public byte[] StringKey()
{
diff --git a/sandbox/PerfNetFramework/PerfNetFramework.csproj b/sandbox/PerfNetFramework/PerfNetFramework.csproj
index a0416f99f..57cbfd36e 100644
--- a/sandbox/PerfNetFramework/PerfNetFramework.csproj
+++ b/sandbox/PerfNetFramework/PerfNetFramework.csproj
@@ -1,12 +1,12 @@
Exe
- net472;netcoreapp2.2
+ net472;net6.0true
-
+
diff --git a/sandbox/Sandbox/Generated.cs b/sandbox/Sandbox/Generated.cs
index 51a08d60b..bc3bcd7aa 100644
--- a/sandbox/Sandbox/Generated.cs
+++ b/sandbox/Sandbox/Generated.cs
@@ -6,15 +6,13 @@
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Resolvers
{
- using System;
-
public class GeneratedResolver : global::MessagePack.IFormatterResolver
{
public static readonly global::MessagePack.IFormatterResolver Instance = new GeneratedResolver();
@@ -45,11 +43,11 @@ static FormatterCache()
internal static class GeneratedResolverGetFormatterHelper
{
- private static readonly global::System.Collections.Generic.Dictionary lookup;
+ private static readonly global::System.Collections.Generic.Dictionary lookup;
static GeneratedResolverGetFormatterHelper()
{
- lookup = new global::System.Collections.Generic.Dictionary(65)
+ lookup = new global::System.Collections.Generic.Dictionary(72)
{
{ typeof(global::GlobalMyEnum[,]), 0 },
{ typeof(global::GlobalMyEnum[]), 1 },
@@ -72,54 +70,61 @@ static GeneratedResolverGetFormatterHelper()
{ typeof(global::ComplexModel), 18 },
{ typeof(global::GlobalMan), 19 },
{ typeof(global::Message), 20 },
- { typeof(global::PerfBenchmarkDotNet.StringKeySerializerTarget), 21 },
- { typeof(global::QuestMessageBody), 22 },
- { typeof(global::SharedData.ArrayOptimizeClass), 23 },
- { typeof(global::SharedData.BarClass), 24 },
- { typeof(global::SharedData.Callback1), 25 },
- { typeof(global::SharedData.Callback1_2), 26 },
- { typeof(global::SharedData.Callback2), 27 },
- { typeof(global::SharedData.Callback2_2), 28 },
- { typeof(global::SharedData.Empty1), 29 },
- { typeof(global::SharedData.Empty2), 30 },
- { typeof(global::SharedData.EmptyClass), 31 },
- { typeof(global::SharedData.EmptyStruct), 32 },
- { typeof(global::SharedData.FirstSimpleData), 33 },
- { typeof(global::SharedData.FooClass), 34 },
- { typeof(global::SharedData.HolderV0), 35 },
- { typeof(global::SharedData.HolderV1), 36 },
- { typeof(global::SharedData.HolderV2), 37 },
- { typeof(global::SharedData.MyClass), 38 },
- { typeof(global::SharedData.MySubUnion1), 39 },
- { typeof(global::SharedData.MySubUnion2), 40 },
- { typeof(global::SharedData.MySubUnion3), 41 },
- { typeof(global::SharedData.MySubUnion4), 42 },
- { typeof(global::SharedData.NestParent.NestContract), 43 },
- { typeof(global::SharedData.NonEmpty1), 44 },
- { typeof(global::SharedData.NonEmpty2), 45 },
- { typeof(global::SharedData.SimpleIntKeyData), 46 },
- { typeof(global::SharedData.SimpleStringKeyData), 47 },
- { typeof(global::SharedData.SimpleStructIntKeyData), 48 },
- { typeof(global::SharedData.SimpleStructStringKeyData), 49 },
- { typeof(global::SharedData.SubUnionType1), 50 },
- { typeof(global::SharedData.SubUnionType2), 51 },
- { typeof(global::SharedData.UnVersionBlockTest), 52 },
- { typeof(global::SharedData.Vector2), 53 },
- { typeof(global::SharedData.Vector3Like), 54 },
- { typeof(global::SharedData.VectorLike2), 55 },
- { typeof(global::SharedData.Version0), 56 },
- { typeof(global::SharedData.Version1), 57 },
- { typeof(global::SharedData.Version2), 58 },
- { typeof(global::SharedData.VersionBlockTest), 59 },
- { typeof(global::SharedData.VersioningUnion), 60 },
- { typeof(global::SharedData.WithIndexer), 61 },
- { typeof(global::SimpleModel), 62 },
- { typeof(global::StampMessageBody), 63 },
- { typeof(global::TextMessageBody), 64 },
+ { typeof(global::MessagePackFormatterFieldUser), 21 },
+ { typeof(global::PerfBenchmarkDotNet.StringKeySerializerTarget), 22 },
+ { typeof(global::QuestMessageBody), 23 },
+ { typeof(global::SharedData.ArrayOptimizeClass), 24 },
+ { typeof(global::SharedData.BarClass), 25 },
+ { typeof(global::SharedData.Callback1), 26 },
+ { typeof(global::SharedData.Callback1_2), 27 },
+ { typeof(global::SharedData.Callback2), 28 },
+ { typeof(global::SharedData.Callback2_2), 29 },
+ { typeof(global::SharedData.DefaultValueIntKeyClassWithExplicitConstructor), 30 },
+ { typeof(global::SharedData.DefaultValueIntKeyClassWithoutExplicitConstructor), 31 },
+ { typeof(global::SharedData.DefaultValueIntKeyStructWithExplicitConstructor), 32 },
+ { typeof(global::SharedData.DefaultValueStringKeyClassWithExplicitConstructor), 33 },
+ { typeof(global::SharedData.DefaultValueStringKeyClassWithoutExplicitConstructor), 34 },
+ { typeof(global::SharedData.DefaultValueStringKeyStructWithExplicitConstructor), 35 },
+ { typeof(global::SharedData.Empty1), 36 },
+ { typeof(global::SharedData.Empty2), 37 },
+ { typeof(global::SharedData.EmptyClass), 38 },
+ { typeof(global::SharedData.EmptyStruct), 39 },
+ { typeof(global::SharedData.FirstSimpleData), 40 },
+ { typeof(global::SharedData.FooClass), 41 },
+ { typeof(global::SharedData.HolderV0), 42 },
+ { typeof(global::SharedData.HolderV1), 43 },
+ { typeof(global::SharedData.HolderV2), 44 },
+ { typeof(global::SharedData.MyClass), 45 },
+ { typeof(global::SharedData.MySubUnion1), 46 },
+ { typeof(global::SharedData.MySubUnion2), 47 },
+ { typeof(global::SharedData.MySubUnion3), 48 },
+ { typeof(global::SharedData.MySubUnion4), 49 },
+ { typeof(global::SharedData.NestParent.NestContract), 50 },
+ { typeof(global::SharedData.NonEmpty1), 51 },
+ { typeof(global::SharedData.NonEmpty2), 52 },
+ { typeof(global::SharedData.SimpleIntKeyData), 53 },
+ { typeof(global::SharedData.SimpleStringKeyData), 54 },
+ { typeof(global::SharedData.SimpleStructIntKeyData), 55 },
+ { typeof(global::SharedData.SimpleStructStringKeyData), 56 },
+ { typeof(global::SharedData.SubUnionType1), 57 },
+ { typeof(global::SharedData.SubUnionType2), 58 },
+ { typeof(global::SharedData.UnVersionBlockTest), 59 },
+ { typeof(global::SharedData.Vector2), 60 },
+ { typeof(global::SharedData.Vector3Like), 61 },
+ { typeof(global::SharedData.VectorLike2), 62 },
+ { typeof(global::SharedData.Version0), 63 },
+ { typeof(global::SharedData.Version1), 64 },
+ { typeof(global::SharedData.Version2), 65 },
+ { typeof(global::SharedData.VersionBlockTest), 66 },
+ { typeof(global::SharedData.VersioningUnion), 67 },
+ { typeof(global::SharedData.WithIndexer), 68 },
+ { typeof(global::SimpleModel), 69 },
+ { typeof(global::StampMessageBody), 70 },
+ { typeof(global::TextMessageBody), 71 },
};
}
- internal static object GetFormatter(Type t)
+ internal static object GetFormatter(global::System.Type t)
{
int key;
if (!lookup.TryGetValue(t, out key))
@@ -150,50 +155,57 @@ internal static object GetFormatter(Type t)
case 18: return new MessagePack.Formatters.ComplexModelFormatter();
case 19: return new MessagePack.Formatters.GlobalManFormatter();
case 20: return new MessagePack.Formatters.MessageFormatter();
- case 21: return new MessagePack.Formatters.PerfBenchmarkDotNet.StringKeySerializerTargetFormatter();
- case 22: return new MessagePack.Formatters.QuestMessageBodyFormatter();
- case 23: return new MessagePack.Formatters.SharedData.ArrayOptimizeClassFormatter();
- case 24: return new MessagePack.Formatters.SharedData.BarClassFormatter();
- case 25: return new MessagePack.Formatters.SharedData.Callback1Formatter();
- case 26: return new MessagePack.Formatters.SharedData.Callback1_2Formatter();
- case 27: return new MessagePack.Formatters.SharedData.Callback2Formatter();
- case 28: return new MessagePack.Formatters.SharedData.Callback2_2Formatter();
- case 29: return new MessagePack.Formatters.SharedData.Empty1Formatter();
- case 30: return new MessagePack.Formatters.SharedData.Empty2Formatter();
- case 31: return new MessagePack.Formatters.SharedData.EmptyClassFormatter();
- case 32: return new MessagePack.Formatters.SharedData.EmptyStructFormatter();
- case 33: return new MessagePack.Formatters.SharedData.FirstSimpleDataFormatter();
- case 34: return new MessagePack.Formatters.SharedData.FooClassFormatter();
- case 35: return new MessagePack.Formatters.SharedData.HolderV0Formatter();
- case 36: return new MessagePack.Formatters.SharedData.HolderV1Formatter();
- case 37: return new MessagePack.Formatters.SharedData.HolderV2Formatter();
- case 38: return new MessagePack.Formatters.SharedData.MyClassFormatter();
- case 39: return new MessagePack.Formatters.SharedData.MySubUnion1Formatter();
- case 40: return new MessagePack.Formatters.SharedData.MySubUnion2Formatter();
- case 41: return new MessagePack.Formatters.SharedData.MySubUnion3Formatter();
- case 42: return new MessagePack.Formatters.SharedData.MySubUnion4Formatter();
- case 43: return new MessagePack.Formatters.SharedData.NestParent_NestContractFormatter();
- case 44: return new MessagePack.Formatters.SharedData.NonEmpty1Formatter();
- case 45: return new MessagePack.Formatters.SharedData.NonEmpty2Formatter();
- case 46: return new MessagePack.Formatters.SharedData.SimpleIntKeyDataFormatter();
- case 47: return new MessagePack.Formatters.SharedData.SimpleStringKeyDataFormatter();
- case 48: return new MessagePack.Formatters.SharedData.SimpleStructIntKeyDataFormatter();
- case 49: return new MessagePack.Formatters.SharedData.SimpleStructStringKeyDataFormatter();
- case 50: return new MessagePack.Formatters.SharedData.SubUnionType1Formatter();
- case 51: return new MessagePack.Formatters.SharedData.SubUnionType2Formatter();
- case 52: return new MessagePack.Formatters.SharedData.UnVersionBlockTestFormatter();
- case 53: return new MessagePack.Formatters.SharedData.Vector2Formatter();
- case 54: return new MessagePack.Formatters.SharedData.Vector3LikeFormatter();
- case 55: return new MessagePack.Formatters.SharedData.VectorLike2Formatter();
- case 56: return new MessagePack.Formatters.SharedData.Version0Formatter();
- case 57: return new MessagePack.Formatters.SharedData.Version1Formatter();
- case 58: return new MessagePack.Formatters.SharedData.Version2Formatter();
- case 59: return new MessagePack.Formatters.SharedData.VersionBlockTestFormatter();
- case 60: return new MessagePack.Formatters.SharedData.VersioningUnionFormatter();
- case 61: return new MessagePack.Formatters.SharedData.WithIndexerFormatter();
- case 62: return new MessagePack.Formatters.SimpleModelFormatter();
- case 63: return new MessagePack.Formatters.StampMessageBodyFormatter();
- case 64: return new MessagePack.Formatters.TextMessageBodyFormatter();
+ case 21: return new MessagePack.Formatters.MessagePackFormatterFieldUserFormatter();
+ case 22: return new MessagePack.Formatters.PerfBenchmarkDotNet.StringKeySerializerTargetFormatter();
+ case 23: return new MessagePack.Formatters.QuestMessageBodyFormatter();
+ case 24: return new MessagePack.Formatters.SharedData.ArrayOptimizeClassFormatter();
+ case 25: return new MessagePack.Formatters.SharedData.BarClassFormatter();
+ case 26: return new MessagePack.Formatters.SharedData.Callback1Formatter();
+ case 27: return new MessagePack.Formatters.SharedData.Callback1_2Formatter();
+ case 28: return new MessagePack.Formatters.SharedData.Callback2Formatter();
+ case 29: return new MessagePack.Formatters.SharedData.Callback2_2Formatter();
+ case 30: return new MessagePack.Formatters.SharedData.DefaultValueIntKeyClassWithExplicitConstructorFormatter();
+ case 31: return new MessagePack.Formatters.SharedData.DefaultValueIntKeyClassWithoutExplicitConstructorFormatter();
+ case 32: return new MessagePack.Formatters.SharedData.DefaultValueIntKeyStructWithExplicitConstructorFormatter();
+ case 33: return new MessagePack.Formatters.SharedData.DefaultValueStringKeyClassWithExplicitConstructorFormatter();
+ case 34: return new MessagePack.Formatters.SharedData.DefaultValueStringKeyClassWithoutExplicitConstructorFormatter();
+ case 35: return new MessagePack.Formatters.SharedData.DefaultValueStringKeyStructWithExplicitConstructorFormatter();
+ case 36: return new MessagePack.Formatters.SharedData.Empty1Formatter();
+ case 37: return new MessagePack.Formatters.SharedData.Empty2Formatter();
+ case 38: return new MessagePack.Formatters.SharedData.EmptyClassFormatter();
+ case 39: return new MessagePack.Formatters.SharedData.EmptyStructFormatter();
+ case 40: return new MessagePack.Formatters.SharedData.FirstSimpleDataFormatter();
+ case 41: return new MessagePack.Formatters.SharedData.FooClassFormatter();
+ case 42: return new MessagePack.Formatters.SharedData.HolderV0Formatter();
+ case 43: return new MessagePack.Formatters.SharedData.HolderV1Formatter();
+ case 44: return new MessagePack.Formatters.SharedData.HolderV2Formatter();
+ case 45: return new MessagePack.Formatters.SharedData.MyClassFormatter();
+ case 46: return new MessagePack.Formatters.SharedData.MySubUnion1Formatter();
+ case 47: return new MessagePack.Formatters.SharedData.MySubUnion2Formatter();
+ case 48: return new MessagePack.Formatters.SharedData.MySubUnion3Formatter();
+ case 49: return new MessagePack.Formatters.SharedData.MySubUnion4Formatter();
+ case 50: return new MessagePack.Formatters.SharedData.NestParent_NestContractFormatter();
+ case 51: return new MessagePack.Formatters.SharedData.NonEmpty1Formatter();
+ case 52: return new MessagePack.Formatters.SharedData.NonEmpty2Formatter();
+ case 53: return new MessagePack.Formatters.SharedData.SimpleIntKeyDataFormatter();
+ case 54: return new MessagePack.Formatters.SharedData.SimpleStringKeyDataFormatter();
+ case 55: return new MessagePack.Formatters.SharedData.SimpleStructIntKeyDataFormatter();
+ case 56: return new MessagePack.Formatters.SharedData.SimpleStructStringKeyDataFormatter();
+ case 57: return new MessagePack.Formatters.SharedData.SubUnionType1Formatter();
+ case 58: return new MessagePack.Formatters.SharedData.SubUnionType2Formatter();
+ case 59: return new MessagePack.Formatters.SharedData.UnVersionBlockTestFormatter();
+ case 60: return new MessagePack.Formatters.SharedData.Vector2Formatter();
+ case 61: return new MessagePack.Formatters.SharedData.Vector3LikeFormatter();
+ case 62: return new MessagePack.Formatters.SharedData.VectorLike2Formatter();
+ case 63: return new MessagePack.Formatters.SharedData.Version0Formatter();
+ case 64: return new MessagePack.Formatters.SharedData.Version1Formatter();
+ case 65: return new MessagePack.Formatters.SharedData.Version2Formatter();
+ case 66: return new MessagePack.Formatters.SharedData.VersionBlockTestFormatter();
+ case 67: return new MessagePack.Formatters.SharedData.VersioningUnionFormatter();
+ case 68: return new MessagePack.Formatters.SharedData.WithIndexerFormatter();
+ case 69: return new MessagePack.Formatters.SimpleModelFormatter();
+ case 70: return new MessagePack.Formatters.StampMessageBodyFormatter();
+ case 71: return new MessagePack.Formatters.TextMessageBodyFormatter();
default: return null;
}
}
@@ -206,7 +218,6 @@ internal static object GetFormatter(Type t)
#pragma warning restore 612
#pragma warning restore SA1312 // Variable names should begin with lower-case letter
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1649 // File name should match first type name
@@ -218,25 +229,22 @@ internal static object GetFormatter(Type t)
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Formatters
{
- using System;
- using System.Buffers;
- using MessagePack;
public sealed class GlobalMyEnumFormatter : global::MessagePack.Formatters.IMessagePackFormatter
{
- public void Serialize(ref MessagePackWriter writer, global::GlobalMyEnum value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::GlobalMyEnum value, global::MessagePack.MessagePackSerializerOptions options)
{
- writer.Write((Int32)value);
+ writer.Write((global::System.Int32)value);
}
- public global::GlobalMyEnum Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::GlobalMyEnum Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
return (global::GlobalMyEnum)reader.ReadInt32();
}
@@ -248,7 +256,6 @@ public void Serialize(ref MessagePackWriter writer, global::GlobalMyEnum value,
#pragma warning restore 618
#pragma warning restore 612
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1403 // File may only contain a single namespace
#pragma warning restore SA1649 // File name should match first type name
@@ -260,25 +267,22 @@ public void Serialize(ref MessagePackWriter writer, global::GlobalMyEnum value,
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Formatters.SharedData
{
- using System;
- using System.Buffers;
- using MessagePack;
public sealed class ByteEnumFormatter : global::MessagePack.Formatters.IMessagePackFormatter
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.ByteEnum value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.ByteEnum value, global::MessagePack.MessagePackSerializerOptions options)
{
- writer.Write((Byte)value);
+ writer.Write((global::System.Byte)value);
}
- public global::SharedData.ByteEnum Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.ByteEnum Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
return (global::SharedData.ByteEnum)reader.ReadByte();
}
@@ -290,7 +294,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.ByteEnum
#pragma warning restore 618
#pragma warning restore 612
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1403 // File may only contain a single namespace
#pragma warning restore SA1649 // File name should match first type name
@@ -303,32 +306,27 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.ByteEnum
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Formatters
{
- using System;
- using System.Buffers;
- using System.Collections.Generic;
- using MessagePack;
-
public sealed class IMessageBodyFormatter : global::MessagePack.Formatters.IMessagePackFormatter
{
- private readonly Dictionary> typeToKeyAndJumpMap;
- private readonly Dictionary keyToJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary keyToJumpMap;
public IMessageBodyFormatter()
{
- this.typeToKeyAndJumpMap = new Dictionary>(3, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
+ this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary>(3, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
{
- { typeof(global::TextMessageBody).TypeHandle, new KeyValuePair(10, 0) },
- { typeof(global::StampMessageBody).TypeHandle, new KeyValuePair(14, 1) },
- { typeof(global::QuestMessageBody).TypeHandle, new KeyValuePair(25, 2) },
+ { typeof(global::TextMessageBody).TypeHandle, new global::System.Collections.Generic.KeyValuePair(10, 0) },
+ { typeof(global::StampMessageBody).TypeHandle, new global::System.Collections.Generic.KeyValuePair(14, 1) },
+ { typeof(global::QuestMessageBody).TypeHandle, new global::System.Collections.Generic.KeyValuePair(25, 2) },
};
- this.keyToJumpMap = new Dictionary(3)
+ this.keyToJumpMap = new global::System.Collections.Generic.Dictionary(3)
{
{ 10, 0 },
{ 14, 1 },
@@ -336,9 +334,9 @@ public IMessageBodyFormatter()
};
}
- public void Serialize(ref MessagePackWriter writer, global::IMessageBody value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::IMessageBody value, global::MessagePack.MessagePackSerializerOptions options)
{
- KeyValuePair keyValuePair;
+ global::System.Collections.Generic.KeyValuePair keyValuePair;
if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair))
{
writer.WriteArrayHeader(2);
@@ -364,7 +362,7 @@ public void Serialize(ref MessagePackWriter writer, global::IMessageBody value,
writer.WriteNil();
}
- public global::IMessageBody Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::IMessageBody Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -373,7 +371,7 @@ public void Serialize(ref MessagePackWriter writer, global::IMessageBody value,
if (reader.ReadArrayHeader() != 2)
{
- throw new InvalidOperationException("Invalid Union data was detected. Type:global::IMessageBody");
+ throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::IMessageBody");
}
options.Security.DepthStep(ref reader);
@@ -414,7 +412,6 @@ public void Serialize(ref MessagePackWriter writer, global::IMessageBody value,
#pragma warning restore 618
#pragma warning restore 612
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1403 // File may only contain a single namespace
#pragma warning restore SA1649 // File name should match first type name
@@ -426,38 +423,33 @@ public void Serialize(ref MessagePackWriter writer, global::IMessageBody value,
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Formatters.SharedData
{
- using System;
- using System.Buffers;
- using System.Collections.Generic;
- using MessagePack;
-
public sealed class IIVersioningUnionFormatter : global::MessagePack.Formatters.IMessagePackFormatter
{
- private readonly Dictionary> typeToKeyAndJumpMap;
- private readonly Dictionary keyToJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary keyToJumpMap;
public IIVersioningUnionFormatter()
{
- this.typeToKeyAndJumpMap = new Dictionary>(1, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
+ this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary>(1, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
{
- { typeof(global::SharedData.MySubUnion1).TypeHandle, new KeyValuePair(0, 0) },
+ { typeof(global::SharedData.MySubUnion1).TypeHandle, new global::System.Collections.Generic.KeyValuePair(0, 0) },
};
- this.keyToJumpMap = new Dictionary(1)
+ this.keyToJumpMap = new global::System.Collections.Generic.Dictionary(1)
{
{ 0, 0 },
};
}
- public void Serialize(ref MessagePackWriter writer, global::SharedData.IIVersioningUnion value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.IIVersioningUnion value, global::MessagePack.MessagePackSerializerOptions options)
{
- KeyValuePair keyValuePair;
+ global::System.Collections.Generic.KeyValuePair keyValuePair;
if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair))
{
writer.WriteArrayHeader(2);
@@ -477,7 +469,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IIVersion
writer.WriteNil();
}
- public global::SharedData.IIVersioningUnion Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.IIVersioningUnion Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -486,7 +478,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IIVersion
if (reader.ReadArrayHeader() != 2)
{
- throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IIVersioningUnion");
+ throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IIVersioningUnion");
}
options.Security.DepthStep(ref reader);
@@ -515,19 +507,19 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IIVersion
public sealed class IUnionCheckerFormatter : global::MessagePack.Formatters.IMessagePackFormatter
{
- private readonly Dictionary> typeToKeyAndJumpMap;
- private readonly Dictionary keyToJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary keyToJumpMap;
public IUnionCheckerFormatter()
{
- this.typeToKeyAndJumpMap = new Dictionary>(4, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
+ this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary>(4, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
{
- { typeof(global::SharedData.MySubUnion1).TypeHandle, new KeyValuePair(0, 0) },
- { typeof(global::SharedData.MySubUnion2).TypeHandle, new KeyValuePair(1, 1) },
- { typeof(global::SharedData.MySubUnion3).TypeHandle, new KeyValuePair(2, 2) },
- { typeof(global::SharedData.MySubUnion4).TypeHandle, new KeyValuePair(3, 3) },
+ { typeof(global::SharedData.MySubUnion1).TypeHandle, new global::System.Collections.Generic.KeyValuePair(0, 0) },
+ { typeof(global::SharedData.MySubUnion2).TypeHandle, new global::System.Collections.Generic.KeyValuePair(1, 1) },
+ { typeof(global::SharedData.MySubUnion3).TypeHandle, new global::System.Collections.Generic.KeyValuePair(2, 2) },
+ { typeof(global::SharedData.MySubUnion4).TypeHandle, new global::System.Collections.Generic.KeyValuePair(3, 3) },
};
- this.keyToJumpMap = new Dictionary(4)
+ this.keyToJumpMap = new global::System.Collections.Generic.Dictionary(4)
{
{ 0, 0 },
{ 1, 1 },
@@ -536,9 +528,9 @@ public IUnionCheckerFormatter()
};
}
- public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChecker value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.IUnionChecker value, global::MessagePack.MessagePackSerializerOptions options)
{
- KeyValuePair keyValuePair;
+ global::System.Collections.Generic.KeyValuePair