diff --git a/Apex.Serialization/Apex.Serialization.csproj b/Apex.Serialization/Apex.Serialization.csproj index a4bf2cb..afa75b8 100644 --- a/Apex.Serialization/Apex.Serialization.csproj +++ b/Apex.Serialization/Apex.Serialization.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5 8.0 2.0.1 Dominic Bolin diff --git a/Apex.Serialization/Binary.Internal.cs b/Apex.Serialization/Binary.Internal.cs index 65e46b1..b273fad 100644 --- a/Apex.Serialization/Binary.Internal.cs +++ b/Apex.Serialization/Binary.Internal.cs @@ -456,7 +456,7 @@ private static Func CreateCloneFunc() { var p = Expression.Parameter(typeof(object)); return Expression.Lambda>( - Expression.Call(p, typeof(object).GetMethod("MemberwiseClone", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.DeclaredOnly)) + Expression.Call(p, typeof(object).GetMethod("MemberwiseClone", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.DeclaredOnly)!) , p ).Compile(); } @@ -468,7 +468,7 @@ private static Action CreateSetTargetAction() return Expression.Lambda>( Expression.Assign( Expression.MakeMemberAccess(p, - typeof(Delegate).GetField("_target", BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.NonPublic)), t) + typeof(Delegate).GetField("_target", BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.NonPublic)!), t) , p, t ).Compile(); } diff --git a/Apex.Serialization/Internal/DynamicCode.cs b/Apex.Serialization/Internal/DynamicCode.cs index 93c767f..a69632e 100644 --- a/Apex.Serialization/Internal/DynamicCode.cs +++ b/Apex.Serialization/Internal/DynamicCode.cs @@ -650,7 +650,7 @@ private static List GetReadStatementsForType(Type type, ImmutableSet readStatements.Add( Expression.IfThen( Expression.Equal(Expression.Call(stream, BinaryStreamMethods.GenericMethods.ReadValueMethodInfo), Expression.Constant((byte)0)), - Expression.Goto(skipReadLabel) + Expression.Goto(skipReadLabel!) ) ); @@ -672,7 +672,7 @@ private static List GetReadStatementsForType(Type type, ImmutableSet SavedReferencesListIndexer, Expression.Decrement(refIndex)), type) ), - Expression.Goto(skipReadLabel) + Expression.Goto(skipReadLabel!) ) ) ) diff --git a/Apex.Serialization/Internal/Reflection/FieldInfoModifier.cs b/Apex.Serialization/Internal/Reflection/FieldInfoModifier.cs index 282b6e8..4256ab8 100644 --- a/Apex.Serialization/Internal/Reflection/FieldInfoModifier.cs +++ b/Apex.Serialization/Internal/Reflection/FieldInfoModifier.cs @@ -35,7 +35,7 @@ static FieldInfoModifier() if (fieldInfo_m_Attributes != null) { var fieldInfoParam = Expression.Parameter(typeof(FieldInfo)); - var castedType = Expression.Convert(fieldInfoParam, type); + var castedType = Expression.Convert(fieldInfoParam, type!); var returnLabel = Expression.Label(); SetFieldInfoNotReadonly = (Action)Expression.Lambda( Expression.Block( diff --git a/Apex.Serialization/Internal/Reflection/TypeFields.cs b/Apex.Serialization/Internal/Reflection/TypeFields.cs index f2bca4d..a58b074 100644 --- a/Apex.Serialization/Internal/Reflection/TypeFields.cs +++ b/Apex.Serialization/Internal/Reflection/TypeFields.cs @@ -21,7 +21,7 @@ static TypeFields() var intPtrParam = Expression.Parameter(typeof(IntPtr)); var objectParam = Expression.Parameter(typeof(object)); - var logicallyNullMethod = typeof(MulticastDelegate).GetMethod("InvocationListLogicallyNull", BindingFlags.Instance | BindingFlags.NonPublic); + var logicallyNullMethod = typeof(MulticastDelegate).GetMethod("InvocationListLogicallyNull", BindingFlags.Instance | BindingFlags.NonPublic)!; getInvocationCount = Expression.Lambda>(Expression.Field(delegateParam, "_invocationCount"), delegateParam).Compile(); getInvocationList = Expression.Lambda>(Expression.Field(delegateParam, "_invocationList"), delegateParam).Compile(); diff --git a/Apex.Serialization/Internal/VersionUniqueIdExpressionVisitor.cs b/Apex.Serialization/Internal/VersionUniqueIdExpressionVisitor.cs index 99255fc..5929ee5 100644 --- a/Apex.Serialization/Internal/VersionUniqueIdExpressionVisitor.cs +++ b/Apex.Serialization/Internal/VersionUniqueIdExpressionVisitor.cs @@ -189,7 +189,7 @@ protected override Expression VisitLabel(LabelExpression node) return base.VisitLabel(node); } - protected override LabelTarget VisitLabelTarget(LabelTarget? node) + protected override LabelTarget? VisitLabelTarget(LabelTarget? node) { if (node != null) { diff --git a/Benchmark/Benchmark.csproj b/Benchmark/Benchmark.csproj index 825d4f3..efd98ad 100644 --- a/Benchmark/Benchmark.csproj +++ b/Benchmark/Benchmark.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5 true Benchmark.snk 8.0 diff --git a/Benchmark/Program.cs b/Benchmark/Program.cs index 41eadf0..717c6de 100644 --- a/Benchmark/Program.cs +++ b/Benchmark/Program.cs @@ -26,8 +26,7 @@ public Config() AddExporter(DefaultConfig.Instance.GetExporters().ToArray()); // manual config has no exporters by default AddColumnProvider(DefaultConfig.Instance.GetColumnProviders().ToArray()); // manual config has no columns by default - //AddJob(Job.Default.With(CsProjCoreToolchain.NetCoreApp30).WithGcServer(false)); - AddJob(Job.Default.With(CsProjCoreToolchain.NetCoreApp31).WithGcServer(true)); + AddJob(Job.Default.WithToolchain(CsProjCoreToolchain.NetCoreApp50).WithGcServer(true)); //AddJob(Job.Clr.With(CsProjClassicNetToolchain.Net472)); //AddJob(Job.CoreRT); //Add(HardwareCounter.BranchMispredictions, HardwareCounter.BranchInstructions); diff --git a/DeserializeTest/DeserializeTest.csproj b/DeserializeTest/DeserializeTest.csproj index 1cd5f43..3c1b2a4 100644 --- a/DeserializeTest/DeserializeTest.csproj +++ b/DeserializeTest/DeserializeTest.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5 diff --git a/DeserializeTest2/DeserializeTest2.csproj b/DeserializeTest2/DeserializeTest2.csproj index 1cd5f43..3c1b2a4 100644 --- a/DeserializeTest2/DeserializeTest2.csproj +++ b/DeserializeTest2/DeserializeTest2.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5 diff --git a/Tests/Apex.Serialization.Tests/Apex.Serialization.Tests.csproj b/Tests/Apex.Serialization.Tests/Apex.Serialization.Tests.csproj index 6438fc1..82687e3 100644 --- a/Tests/Apex.Serialization.Tests/Apex.Serialization.Tests.csproj +++ b/Tests/Apex.Serialization.Tests/Apex.Serialization.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5 false 8.0 true @@ -12,10 +12,6 @@ CS8605;CS8602;CS0649;CS8002 - - NETCOREAPP - - all