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
2 changes: 1 addition & 1 deletion .github/workflows/commit-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ jobs:
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '10.0.x'

- name: Run checks
run: |
Expand Down
4 changes: 2 additions & 2 deletions DEVNOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Apache Ignite Maven Build Instructions
./mvnw clean install -Pall-java,licenses -DskipTests

or if you have to build .NET part as well, use the following command:
(Note that 'doxygen', `docfx`, '.NET 6 SDK', 'PowerShell' should be installed before running this command.)
(Note that 'doxygen', `docfx`, '.NET 10 SDK', 'PowerShell' should be installed before running this command.)

./mvnw clean install -Pall-java,licenses,build-dotnet -DskipTests -DclientDocs

Expand Down Expand Up @@ -45,7 +45,7 @@ Apache Ignite with LGPL Maven Build Instructions
./mvnw clean install -Pall-java,licenses -DskipTests

or if you have to build .NET part as well, use the following command:
(Note that 'doxygen', `docfx`, '.NET 6 SDK', 'PowerShell' should be installed before running this command.)
(Note that 'doxygen', `docfx`, '.NET 10 SDK', 'PowerShell' should be installed before running this command.)

./mvnw clean install -Pall-java,licenses,build-dotnet -DskipTests -DclientDocs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AssemblyOriginatorKeyFile>Apache.Ignite.BenchmarkDotNet.snk</AssemblyOriginatorKeyFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyName>Apache.Ignite.Benchmarks</AssemblyName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void Run()
PrintDebug("Waiting worker threads to start: " + Threads);

// Await for all threads to start in spin loop.
while (Thread.VolatileRead(ref _readyThreads) < Threads)
while (Volatile.Read(ref _readyThreads) < Threads)
Thread.Sleep(10);

PrintDebug("Worker threads started: " + Threads);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
Expand Down Expand Up @@ -29,6 +29,7 @@
<ItemGroup>
<PackageReference Include="log4net" Version="3.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="System.CodeDom" Version="4.5.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1884,9 +1884,17 @@ public TestHashTable()
}

// ReSharper disable once UnusedMember.Global
protected TestHashTable(SerializationInfo info, StreamingContext context) : base(info, context)
protected TestHashTable(SerializationInfo info, StreamingContext context)
{
// No-op.
// Hashtable serialization ctor is obsolete on modern .NET (SYSLIB0051).
// Restore entries manually from the data written by Hashtable.GetObjectData.
var keys = (object[]) info.GetValue("Keys", typeof(object[]));
var values = (object[]) info.GetValue("Values", typeof(object[]));

for (var i = 0; i < keys.Length; i++)
{
Add(keys[i], values[i]);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,14 +427,18 @@ public EmptyObject()
/// </summary>
private EmptyObject(SerializationInfo info, StreamingContext context)
{
#if NETFRAMEWORK
Assert.AreEqual(StreamingContextStates.All, context.State);
#endif
Assert.IsNull(context.Context);
}

/** <inheritdoc /> */
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
#if NETFRAMEWORK
Assert.AreEqual(StreamingContextStates.All, context.State);
#endif
Assert.IsNull(context.Context);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)
}

[Serializable]
// Ignite's SerializableSerializer supports the IObjectReference hook; the interface is
// deprecated by .NET but is still functional and intentionally exercised by this test.
#pragma warning disable SYSLIB0050 // IObjectReference is obsolete
private class ObjectInfoHolder : IObjectReference, ISerializable
#pragma warning restore SYSLIB0050
{
public Type ObjectType { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,23 @@ public CustomStoreException(string message) : base(message)
Details = message;
}

// Formatter-based exception serialization requires the deprecated base ctor:
// Message can only be restored by Exception(SerializationInfo, StreamingContext).
#pragma warning disable SYSLIB0051 // Exception serialization ctor is obsolete
protected CustomStoreException(SerializationInfo info, StreamingContext ctx) : base(info, ctx)
#pragma warning restore SYSLIB0051
{
Details = info.GetString("details");
}

#pragma warning disable SYSLIB0051, CS0672 // Exception.GetObjectData is obsolete
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("details", Details);

base.GetObjectData(info, context);
}
#pragma warning restore SYSLIB0051, CS0672
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ public EmptyObject()
/// </summary>
private EmptyObject(SerializationInfo info, StreamingContext context)
{
#if NETFRAMEWORK
Assert.AreEqual(StreamingContextStates.All, context.State);
#endif
Assert.IsNull(context.Context);
}

/** <inheritdoc /> */
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
#if NETFRAMEWORK
Assert.AreEqual(StreamingContextStates.All, context.State);
#endif
Assert.IsNull(context.Context);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ private static X509Certificate2 LoadCertificateFile()
// Converting from JKS to PFX:
// keytool -importkeystore -srckeystore thekeystore.jks -srcstoretype JKS
// -destkeystore thekeystore.pfx -deststoretype PKCS12
#if NETFRAMEWORK
return new X509Certificate2(Path.Combine("Config", "Client", "thin-client-cert.pfx"), "123456");
#else
return X509CertificateLoader.LoadPkcs12FromFile(
Path.Combine("Config", "Client", "thin-client-cert.pfx"), "123456");
#endif
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,11 +741,14 @@ protected GoodException(SerializationInfo info, StreamingContext context)
}

/** <inheritDoc /> */
#if !NETFRAMEWORK
[Obsolete]
#endif
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
// Exception.GetObjectData is obsolete (SYSLIB0051) and not needed: the serialization
// ctor only reads the "mode" value.
info.AddValue("mode", (int)Mode);

base.GetObjectData(info, context);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,24 @@ public SerializableException(string msg) : this()
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
// Formatter-based exception serialization requires the deprecated base ctor:
// Message can only be restored by Exception(SerializationInfo, StreamingContext).
#pragma warning disable SYSLIB0051 // Exception serialization ctor is obsolete
protected SerializableException(SerializationInfo info, StreamingContext context) : base(info, context)
#pragma warning restore SYSLIB0051
{
Msg = info.GetString("msg");
}

/** <inheritDoc /> */
#pragma warning disable SYSLIB0051, CS0672 // Exception.GetObjectData is obsolete
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("msg", Msg);

base.GetObjectData(info, context);
}
#pragma warning restore SYSLIB0051, CS0672
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ private static void CheckException<T>(ICompute comp, string name) where T : Exce
Assert.AreEqual(name, javaEx.JavaMessage);
Assert.IsTrue(javaEx.JavaClassName.EndsWith("." + name));

#if NETFRAMEWORK
// Check serialization.
var formatter = new BinaryFormatter();
using (var ms = new MemoryStream())
{
#pragma warning disable SYSLIB0011 // BinaryFormatter is obsolete
formatter.Serialize(ms, ex);

ms.Seek(0, SeekOrigin.Begin);
Expand All @@ -132,8 +132,8 @@ private static void CheckException<T>(ICompute comp, string name) where T : Exce
Assert.AreEqual(javaEx.StackTrace, resJavaEx.StackTrace);
Assert.AreEqual(javaEx.Source, resJavaEx.Source);
Assert.AreEqual(javaEx.HelpLink, resJavaEx.HelpLink);
#pragma warning restore SYSLIB0011 // BinaryFormatter is obsolete
}
#endif
}

/// <summary>
Expand Down Expand Up @@ -194,7 +194,12 @@ public void TestAllExceptionsConstructors()

foreach (var type in types)
{
#if NETFRAMEWORK
Assert.IsTrue(type.IsSerializable, "Exception is not serializable: " + type);
#else
// IsSerializable is obsolete on modern .NET; check the attribute directly.
Assert.IsTrue(type.IsDefined(typeof(SerializableAttribute), false), "Exception is not serializable: " + type);
#endif

// Default ctor.
var defCtor = type.GetConstructor(new Type[0]);
Expand All @@ -211,16 +216,16 @@ public void TestAllExceptionsConstructors()
Assert.AreEqual("myMessage", ex.Message);

// Serialization.
#if NETFRAMEWORK
var stream = new MemoryStream();
var formatter = new BinaryFormatter();

#pragma warning disable SYSLIB0011 // BinaryFormatter is obsolete
formatter.Serialize(stream, ex);
stream.Seek(0, SeekOrigin.Begin);

ex = (Exception) formatter.Deserialize(stream);
Assert.AreEqual("myMessage", ex.Message);
#pragma warning restore SYSLIB0011 // BinaryFormatter is obsolete
#endif

// Message+cause ctor.
var msgCauseCtor = type.GetConstructor(new[] { typeof(string), typeof(Exception) });
Expand All @@ -238,17 +243,16 @@ public void TestAllExceptionsConstructors()
/// </summary>
private static void TestPartialUpdateExceptionSerialization(Exception ex)
{
#if NETFRAMEWORK
var formatter = new BinaryFormatter();

var stream = new MemoryStream();

#pragma warning disable SYSLIB0011 // BinaryFormatter is obsolete
formatter.Serialize(stream, ex);

stream.Seek(0, SeekOrigin.Begin);

var ex0 = (Exception) formatter.Deserialize(stream);
#pragma warning restore SYSLIB0011 // BinaryFormatter is obsolete

var updateEx = ((CachePartialUpdateException) ex);

Expand All @@ -273,6 +277,10 @@ private static void TestPartialUpdateExceptionSerialization(Exception ex)
}

Assert.AreEqual(ex, ex0);
#else
// BinaryFormatter is not supported on modern .NET: skip the serialization round-trip.
Assert.Ignore("BinaryFormatter serialization check requires .NET Framework.");
#endif
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,23 +284,23 @@ public void TestLocalListenMultithreaded()
{
Interlocked.Increment(ref localReceived);
Thread.MemoryBarrier();
return Thread.VolatileRead(ref stopLocal) == 0;
return Volatile.Read(ref stopLocal) == 0;
});

messaging.LocalListen(localListener);

Thread.Sleep(100);

Thread.VolatileWrite(ref stopLocal, 1);
Volatile.Write(ref stopLocal, 1);

Thread.Sleep(1000);

var result = Thread.VolatileRead(ref localReceived);
var result = Volatile.Read(ref localReceived);

Thread.Sleep(100);

// Check that unsubscription worked properly
Assert.AreEqual(result, Thread.VolatileRead(ref localReceived));
Assert.AreEqual(result, Volatile.Read(ref localReceived));

messaging.StopLocalListen(sharedListener);

Expand All @@ -310,14 +310,14 @@ public void TestLocalListenMultithreaded()

Thread.Sleep(100);

var sharedResult = Thread.VolatileRead(ref sharedReceived);
var sharedResult = Volatile.Read(ref sharedReceived);

messaging.Send(NextMessage());

Thread.Sleep(MessagingTestHelper.SleepTimeout);

// Check that unsubscription worked properly
Assert.AreEqual(sharedResult, Thread.VolatileRead(ref sharedReceived));
Assert.AreEqual(sharedResult, Volatile.Read(ref sharedReceived));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<OutputType>Exe</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyName>Apache.Ignite.Executable</AssemblyName>
Expand Down
4 changes: 2 additions & 2 deletions modules/platforms/dotnet/DEVNOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Requirements
============

* Oracle JDK 17
* .NET 6 SDK
* .NET 10 SDK
* JAVA_HOME environment variable set to the corresponding JDK (x64 or x86)
* Apache Maven bin directory in PATH, or MAVEN_HOME environment variable
* PowerShell
Expand All @@ -20,7 +20,7 @@ Resulting binaries will be in bin folder, and NuGet packages in nupkg folder.
Build Apache Ignite .NET with Maven
===================================

Note that .NET 6 SDK and PowerShell must be installed first.
Note that .NET 10 SDK and PowerShell must be installed first.

The command below will build the binaries and NuGet packages with Maven:

Expand Down
2 changes: 1 addition & 1 deletion modules/platforms/dotnet/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ if (!$skipDotNet) {
}

if(!$skipDotNetCore) {
Build-Solution ".\Apache.Ignite.DotNetCore.sln" "bin\net6.0"
Build-Solution ".\Apache.Ignite.DotNetCore.sln" "bin\net10.0"
}


Expand Down
Loading