Skip to content

Commit f77ceef

Browse files
committed
net8 compilation warnings resolved
1 parent 1236845 commit f77ceef

26 files changed

Lines changed: 104 additions & 26 deletions

Orm/Xtensive.Orm.Tests.Core/DotNetFramework/AllocationTest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ private void TestClassAllocation(double speedFactor)
9292
// Warmup
9393
int iterations = 100;
9494
AllocateClass_SlimObject(iterations);
95+
#if !NET8_0_OR_GREATER
9596
AllocateClass_SlimObject_ByFormatterServices(iterations);
97+
#endif
9698
AllocateClass_FinalizableSlimObject(iterations);
9799
AllocateClass_InheritedObject3(iterations);
98100
AllocateClass<SlimObject>(iterations);
@@ -110,8 +112,10 @@ private void TestClassAllocation(double speedFactor)
110112
using (new Measurement("SlimObject", MeasurementOptions.Log, iterations))
111113
AllocateClass_SlimObject(iterations);
112114
TestHelper.CollectGarbage();
115+
#if !NET8_0_OR_GREATER
113116
using (new Measurement("SlimObject (using FormatterServices)", MeasurementOptions.Log, iterations))
114117
AllocateClass_SlimObject_ByFormatterServices(iterations);
118+
#endif
115119
TestHelper.CollectGarbage();
116120
using (new Measurement("FinalizableSlimObject", MeasurementOptions.Log, iterations))
117121
AllocateClass_FinalizableSlimObject(iterations);
@@ -209,6 +213,7 @@ private void AllocateClass_InheritedObject3(int iterationCount)
209213
new InheritedObject3();
210214
}
211215
}
216+
#if !NET8_0_OR_GREATER
212217

213218
private void AllocateClass_SlimObject_ByFormatterServices(int iterationCount)
214219
{
@@ -226,6 +231,7 @@ private void AllocateClass_SlimObject_ByFormatterServices(int iterationCount)
226231
FormatterServices.GetUninitializedObject(type);
227232
}
228233
}
234+
#endif
229235

230236
private void AllocateClass_FinalizableSlimObject(int iterationCount)
231237
{

Orm/Xtensive.Orm.Tests.Core/Modelling/IndexingModel/Exceptions/ValidationException.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public ValidationException(string message, string nodePath)
5353
#region Serializing members
5454

5555
/// <inheritdoc/>
56+
#if NET8_0_OR_GREATER
57+
[Obsolete(DiagnosticId = "SYSLIB0051")]
58+
#endif
5659
protected ValidationException(SerializationInfo info, StreamingContext context)
5760
: base(info, context)
5861
{
@@ -61,6 +64,9 @@ protected ValidationException(SerializationInfo info, StreamingContext context)
6164

6265
/// <inheritdoc/>
6366
[SecurityCritical]
67+
#if NET8_0_OR_GREATER
68+
[Obsolete(DiagnosticId = "SYSLIB0051")]
69+
#endif
6470
public override void GetObjectData(SerializationInfo info, StreamingContext context)
6571
{
6672
info.AddValue("NodePath", NodePath);

Orm/Xtensive.Orm/Core/Exceptions/ActivationException.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public ActivationException(string message, Exception innerException)
4848
/// </summary>
4949
/// <param name="info"></param>
5050
/// <param name="context"></param>
51+
#if NET8_0_OR_GREATER
52+
[Obsolete(DiagnosticId = "SYSLIB0051")]
53+
#endif
5154
protected ActivationException(SerializationInfo info, StreamingContext context)
5255
: base(info, context)
5356
{

Orm/Xtensive.Orm/Core/Exceptions/AggregateException.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ public AggregateException(string message, Exception[] exceptions)
138138
/// </summary>
139139
/// <param name="info"></param>
140140
/// <param name="context"></param>
141+
#if NET8_0_OR_GREATER
142+
[Obsolete(DiagnosticId = "SYSLIB0051")]
143+
#endif
141144
protected AggregateException(SerializationInfo info, StreamingContext context)
142145
: base(info, context)
143146
{
@@ -150,6 +153,9 @@ protected AggregateException(SerializationInfo info, StreamingContext context)
150153
/// <param name="info"></param>
151154
/// <param name="context"></param>
152155
[SecurityCritical]
156+
#if NET8_0_OR_GREATER
157+
[Obsolete(DiagnosticId = "SYSLIB0051")]
158+
#endif
153159
public override void GetObjectData(SerializationInfo info, StreamingContext context)
154160
{
155161
base.GetObjectData(info, context);

Orm/Xtensive.Orm/Core/Exceptions/InstanceIsLockedException.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public InstanceIsLockedException(string text)
4040
/// </summary>
4141
/// <param name="info"><see cref="SerializationInfo"/> object.</param>
4242
/// <param name="context"><see cref="StreamingContext"/> object.</param>
43+
#if NET8_0_OR_GREATER
44+
[Obsolete(DiagnosticId = "SYSLIB0051")]
45+
#endif
4346
protected InstanceIsLockedException(SerializationInfo info, StreamingContext context)
4447
: base(info, context)
4548
{

Orm/Xtensive.Orm/Orm/Exceptions/CheckConstraintViolationException.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ public CheckConstraintViolationException(string message, Exception innerExceptio
4646
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
4747
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
4848
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is null. </exception>
49-
///
5049
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0). </exception>
50+
#if NET8_0_OR_GREATER
51+
[Obsolete(DiagnosticId = "SYSLIB0051")]
52+
#endif
5153
private CheckConstraintViolationException(SerializationInfo info, StreamingContext context)
5254
: base(info, context)
5355
{
54-
}
56+
}
5557
}
5658
}

Orm/Xtensive.Orm/Orm/Exceptions/ConnectionErrorException.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ public ConnectionErrorException(string message, Exception innerException)
4545
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
4646
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
4747
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is null. </exception>
48-
///
4948
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0). </exception>
49+
#if NET8_0_OR_GREATER
50+
[Obsolete(DiagnosticId = "SYSLIB0051")]
51+
#endif
5052
private ConnectionErrorException(SerializationInfo info, StreamingContext context)
5153
: base(info, context)
5254
{
53-
}
55+
}
5456
}
5557
}

Orm/Xtensive.Orm/Orm/Exceptions/ConstraintViolationException.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ public ConstraintViolationException(string message, Exception innerException)
4848
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
4949
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
5050
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is null. </exception>
51-
///
5251
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0). </exception>
52+
#if NET8_0_OR_GREATER
53+
[Obsolete(DiagnosticId = "SYSLIB0051")]
54+
#endif
5355
protected ConstraintViolationException(SerializationInfo info, StreamingContext context)
5456
: base(info, context)
5557
{
56-
}
58+
}
5759
}
5860
}

Orm/Xtensive.Orm/Orm/Exceptions/DeadlockException.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public DeadlockException(string message, Exception innerException)
4545
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
4646
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
4747
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is null. </exception>
48-
///
4948
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0). </exception>
49+
#if NET8_0_OR_GREATER
50+
[Obsolete(DiagnosticId = "SYSLIB0051")]
51+
#endif
5052
private DeadlockException(SerializationInfo info, StreamingContext context)
5153
: base(info, context)
5254
{

Orm/Xtensive.Orm/Orm/Exceptions/DomainBuilderException.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public DomainBuilderException(string message, Exception innerException)
4545
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
4646
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
4747
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is null. </exception>
48-
///
4948
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0). </exception>
49+
#if NET8_0_OR_GREATER
50+
[Obsolete(DiagnosticId = "SYSLIB0051")]
51+
#endif
5052
private DomainBuilderException(SerializationInfo info, StreamingContext context)
5153
: base(info, context)
5254
{

0 commit comments

Comments
 (0)