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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions MemoryPack.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SandboxWebApp", "sandbox\Sa
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MemoryPack.AspNetCoreMvcFormatter", "src\MemoryPack.AspNetCoreMvcFormatter\MemoryPack.AspNetCoreMvcFormatter.csproj", "{64B20612-4990-40C7-8191-E2A033CD1EF5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SandboxNet6", "sandbox\SandboxNet6\SandboxNet6.csproj", "{87C0CEAA-E511-46AA-93AB-AF742A1F8EE2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassLibrary", "sandbox\ClassLibrary\ClassLibrary.csproj", "{0ADCE3AF-C900-4FCB-938B-654211EDD6BE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NativeAot", "sandbox\NativeAot\NativeAot.csproj", "{6E18AECF-34B2-48F9-9694-54150FB156EB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Net6VsNet7", "sandbox\Net6VsNet7\Net6VsNet7.csproj", "{5612B811-586A-4EB3-9AE7-60CAD4969A1B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MemoryPack.UnityShims", "src\MemoryPack.UnityShims\MemoryPack.UnityShims.csproj", "{9339C66C-25E5-4130-A213-9BA1804AD562}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MemoryPack.Tests.NetStandard", "tests\MemoryPack.Tests.NetStandard\MemoryPack.Tests.NetStandard.csproj", "{B498EF75-D4BB-4B60-B15D-A9DD4059275A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -98,12 +96,6 @@ Global
{64B20612-4990-40C7-8191-E2A033CD1EF5}.Release|Any CPU.Build.0 = Release|Any CPU
{64B20612-4990-40C7-8191-E2A033CD1EF5}.WinBenchmark|Any CPU.ActiveCfg = Release|Any CPU
{64B20612-4990-40C7-8191-E2A033CD1EF5}.WinBenchmark|Any CPU.Build.0 = Release|Any CPU
{87C0CEAA-E511-46AA-93AB-AF742A1F8EE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{87C0CEAA-E511-46AA-93AB-AF742A1F8EE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87C0CEAA-E511-46AA-93AB-AF742A1F8EE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87C0CEAA-E511-46AA-93AB-AF742A1F8EE2}.Release|Any CPU.Build.0 = Release|Any CPU
{87C0CEAA-E511-46AA-93AB-AF742A1F8EE2}.WinBenchmark|Any CPU.ActiveCfg = Release|Any CPU
{87C0CEAA-E511-46AA-93AB-AF742A1F8EE2}.WinBenchmark|Any CPU.Build.0 = Release|Any CPU
{0ADCE3AF-C900-4FCB-938B-654211EDD6BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0ADCE3AF-C900-4FCB-938B-654211EDD6BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0ADCE3AF-C900-4FCB-938B-654211EDD6BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -116,18 +108,18 @@ Global
{6E18AECF-34B2-48F9-9694-54150FB156EB}.Release|Any CPU.Build.0 = Release|Any CPU
{6E18AECF-34B2-48F9-9694-54150FB156EB}.WinBenchmark|Any CPU.ActiveCfg = Debug|Any CPU
{6E18AECF-34B2-48F9-9694-54150FB156EB}.WinBenchmark|Any CPU.Build.0 = Debug|Any CPU
{5612B811-586A-4EB3-9AE7-60CAD4969A1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5612B811-586A-4EB3-9AE7-60CAD4969A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5612B811-586A-4EB3-9AE7-60CAD4969A1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5612B811-586A-4EB3-9AE7-60CAD4969A1B}.Release|Any CPU.Build.0 = Release|Any CPU
{5612B811-586A-4EB3-9AE7-60CAD4969A1B}.WinBenchmark|Any CPU.ActiveCfg = Debug|Any CPU
{5612B811-586A-4EB3-9AE7-60CAD4969A1B}.WinBenchmark|Any CPU.Build.0 = Debug|Any CPU
{9339C66C-25E5-4130-A213-9BA1804AD562}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9339C66C-25E5-4130-A213-9BA1804AD562}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9339C66C-25E5-4130-A213-9BA1804AD562}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9339C66C-25E5-4130-A213-9BA1804AD562}.Release|Any CPU.Build.0 = Release|Any CPU
{9339C66C-25E5-4130-A213-9BA1804AD562}.WinBenchmark|Any CPU.ActiveCfg = Debug|Any CPU
{9339C66C-25E5-4130-A213-9BA1804AD562}.WinBenchmark|Any CPU.Build.0 = Debug|Any CPU
{B498EF75-D4BB-4B60-B15D-A9DD4059275A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B498EF75-D4BB-4B60-B15D-A9DD4059275A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B498EF75-D4BB-4B60-B15D-A9DD4059275A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B498EF75-D4BB-4B60-B15D-A9DD4059275A}.Release|Any CPU.Build.0 = Release|Any CPU
{B498EF75-D4BB-4B60-B15D-A9DD4059275A}.WinBenchmark|Any CPU.ActiveCfg = Release|Any CPU
{B498EF75-D4BB-4B60-B15D-A9DD4059275A}.WinBenchmark|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -142,11 +134,10 @@ Global
{31F067EA-3E16-47DD-A6E6-9AFDDD82E22F} = {796FB992-A35C-405B-82A7-4C90C5673174}
{F9D66CB1-8D28-426B-BB12-C9F5D30EC6A0} = {796FB992-A35C-405B-82A7-4C90C5673174}
{64B20612-4990-40C7-8191-E2A033CD1EF5} = {81B295E0-EEDE-4D5B-B4AC-1202D5E6B3CF}
{87C0CEAA-E511-46AA-93AB-AF742A1F8EE2} = {796FB992-A35C-405B-82A7-4C90C5673174}
{0ADCE3AF-C900-4FCB-938B-654211EDD6BE} = {796FB992-A35C-405B-82A7-4C90C5673174}
{6E18AECF-34B2-48F9-9694-54150FB156EB} = {796FB992-A35C-405B-82A7-4C90C5673174}
{5612B811-586A-4EB3-9AE7-60CAD4969A1B} = {796FB992-A35C-405B-82A7-4C90C5673174}
{9339C66C-25E5-4130-A213-9BA1804AD562} = {81B295E0-EEDE-4D5B-B4AC-1202D5E6B3CF}
{B498EF75-D4BB-4B60-B15D-A9DD4059275A} ={204004F9-9B91-4DD1-812C-80D629169ED5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {01ADF7A3-0758-4A3C-9A18-AEF0F30B6E1B}
Expand Down
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Other than performance, MemoryPack has these features.

Installation
---
This library is distributed via NuGet. For best performance, recommend to use `.NET 7`. Minimum requirement is `.NET Standard 2.1`.
This library is distributed via NuGet. For best performance, recommend to use `.NET 10`. Minimum requirement is `.NET Standard 2.1`.

> PM> Install-Package [MemoryPack](https://www.nuget.org/packages/MemoryPack)

Expand Down Expand Up @@ -1379,16 +1379,16 @@ using (var state = MemoryPackReaderOptionalStatePool.Rent(MemoryPackSerializerOp

Target framework dependency
---
MemoryPack provides `netstandard2.1` and `net7.0` but both are not compatible. For example, MemoryPackable types under `netstandard2.1` project and use it from `net7.0` project, throws runtime exception like this
MemoryPack provides `netstandard2.1`, `net8.0` and `net10.0`, but the `netstandard2.1` build is not compatible with the `net8.0` and `net10.0` builds. For example, MemoryPackable types under `netstandard2.1` project and use it from `net8.0` project, throws runtime exception like this

> Unhandled exception. System.TypeLoadException: Virtual static method '*' is not implemented on type '*' from assembly '*'.

Since net7.0 uses static abstract members (`Virtual static method`), that does not support netstandard2.1, this behavior is a specification.
Since net8.0 and net10.0 use static abstract members (`Virtual static method`), that does not support netstandard2.1, this behavior is a specification. Applications on .NET 7 or lower use the netstandard2.1 build.

.NET 7 project shouldn't use the netstandard 2.1 dll. In other words, if the Application is a .NET 7 Project, all the dependencies that use MemoryPack must support .NET 7. So if a library developer has a dependency on MemoryPack, you need to configure dual target framework.
.NET 8 or later project shouldn't use the netstandard 2.1 dll. In other words, if the Application is a .NET 8 or later Project, all the dependencies that use MemoryPack must support .NET 8 or later. So if a library developer has a dependency on MemoryPack, you need to configure dual target framework.

```xml
<TargetFrameworks>netstandard2.1;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
```

RPC
Expand Down Expand Up @@ -1448,11 +1448,6 @@ The `MemoryPack.UnityShims` package provides shims for Unity's standard structs
- Currently, the simple solution is to not use these types. For `DateTimeOffset`, you can use `Net10DateTimeOffset` or `UnityDateTimeOffset` instead, see [DateTimeOffset, Net10DateTimeOffset and UnityDateTimeOffset](#datetimeoffset-net10datetimeoffset-and-unitydatetimeoffset).


Native AOT
---
Unfortunately, .NET 7 Native AOT causes crash (`Generic virtual method pointer lookup failure`) when use MemoryPack due to a runtime bug. It
is going to be fixed in .NET 8. Using ``Microsoft.DotNet.ILCompiler` preview version, will fix it in .NET 7. Please see [issue's comment](https://github.com/Cysharp/MemoryPack/issues/75#issuecomment-1386884611) how setup it.

Binary wire format specification
---
The type of `T` defined in `Serialize<T>` and `Deserialize<T>` is called C# schema. MemoryPack format is not self-described format. Deserialize requires the corresponding C# schema. These types exist as internal representations of binaries, but types cannot be determined without a C# schema.
Expand Down
26 changes: 0 additions & 26 deletions sandbox/Net6VsNet7/Net6VsNet7.csproj

This file was deleted.

98 changes: 0 additions & 98 deletions sandbox/Net6VsNet7/Program.cs

This file was deleted.

16 changes: 0 additions & 16 deletions sandbox/SandboxNet6/NamespaceTest.cs

This file was deleted.

Loading
Loading