Skip to content

Commit 2bc0f9d

Browse files
a-ctorMichaelKetting
authored andcommitted
Merge pull request #35 from re-motion/feature/RMLNQSQL-170-Support-NET-9
RMLNQSQL-170 Add support for .NET 9.0
2 parents 8cdce18 + 340d4ce commit 2bc0f9d

File tree

9 files changed

+21
-12
lines changed

9 files changed

+21
-12
lines changed

Core/MappingResolution/UnmappedItemException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ namespace Remotion.Linq.SqlBackend.MappingResolution
2424
/// The <see cref="UnmappedItemException"/> is thrown if the <see cref="IMappingResolver"/> implementation
2525
/// is unable to associate an part of the query model with the mapping.
2626
/// </summary>
27+
#if NETFRAMEWORK
2728
[Serializable]
29+
#endif
2830
public sealed class UnmappedItemException : Exception
2931
{
3032
#if NETFRAMEWORK
@@ -46,14 +48,12 @@ public UnmappedItemException (string message, Exception innerException)
4648
#endif
4749
}
4850

49-
#pragma warning disable SYSLIB0051
51+
#if NETFRAMEWORK
5052
private UnmappedItemException (SerializationInfo info, StreamingContext context)
5153
: base(info, context)
5254
{
5355
}
54-
#pragma warning restore
5556

56-
#if NETFRAMEWORK
5757
[Serializable]
5858
private struct UnmappedItemExceptionState : ISafeSerializationData
5959
{

IntegrationTests.CSharp/MiscTests/DateTimeAddTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ public void Add_TimeSpan ()
197197
Seven = o.OrderDate.Value.Add (TimeSpan.FromDays (0.0001)),
198198
Eight = o.OrderDate.Value.Add (TimeSpan.FromDays (-0.0001)),
199199
Nine = o.OrderDate.Value.Add (TimeSpan.FromMilliseconds (1.5)),
200+
#if NET9_0_OR_GREATER
201+
Ten = o.OrderDate.Value.Add (TimeSpan.FromMilliseconds (-2, 0L)), // TODO RMLNQSQL-154: Revert to '-1.5' when RMLNQSQL-154 is implemented.
202+
#else
200203
Ten = o.OrderDate.Value.Add (TimeSpan.FromMilliseconds (-2)), // TODO RMLNQSQL-154: Revert to '-1.5' when RMLNQSQL-154 is implemented.
204+
#endif
201205
Eleven = o.OrderDate.Value.Add (TimeSpan.FromMilliseconds (1500.76)),
202206
Twelve = o.OrderDate.Value.Add (TimeSpan.FromMilliseconds (-1500.76)),
203207
Thirteen = o.OrderDate.Value.Add (TimeSpan.FromMilliseconds (54987987987987.7)),

IntegrationTests.Common/IntegrationTests.Common.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
<PackageReference Include="System.Configuration.ConfigurationManager" VersionOverride="8.0.0-preview.*" />
3939
</ItemGroup>
4040

41+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
42+
<PackageReference Include="Core.Data.Linq" />
43+
<PackageReference Include="System.Configuration.ConfigurationManager" VersionOverride="9.0.0-preview.6.24327.7" />
44+
</ItemGroup>
45+
4146
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
4247
<Reference Include="System.Configuration" />
4348
<Reference Include="System.Data.Linq" />

IntegrationTests.Common/Utilities/SqlBatchCommandException.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
namespace Remotion.Linq.IntegrationTests.Common.Utilities
2020
{
21+
#if NETFRAMEWORK
2122
[Serializable]
23+
#endif
2224
public class SqlBatchCommandException : Exception
2325
{
2426
/// <summary>

Shared.build.props

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,20 @@
2323
<PackageTags>re-motion LINQ SQL SqlGeneration</PackageTags>
2424
</PropertyGroup>
2525

26-
<PropertyGroup>
27-
<BinaryFormatterSerializationObsoleteWarning>SYSLIB0011</BinaryFormatterSerializationObsoleteWarning>
28-
</PropertyGroup>
29-
3026
<PropertyGroup Condition="'$(ProjectType)' == 'Library'">
3127
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3228
<NoWarn>1591</NoWarn>
3329
<GenerateDocumentationFile>True</GenerateDocumentationFile>
3430
<IsPackable>True</IsPackable>
35-
<TargetFrameworks>net6.0;net7.0;net8.0;net45</TargetFrameworks>
31+
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net45</TargetFrameworks>
3632
<DefineConstants Condition="'$(TargetFramework)' == 'net45'">$(DefineConstants);NETFRAMEWORK</DefineConstants>
3733
</PropertyGroup>
3834

3935
<PropertyGroup Condition="'$(ProjectType)' == 'Test'">
4036
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
41-
<NoWarn>$(BinaryFormatterSerializationObsoleteWarning)</NoWarn>
4237
<GenerateDocumentationFile>False</GenerateDocumentationFile>
4338
<IsPackable>False</IsPackable>
44-
<TargetFrameworks>net6.0;net7.0;net8.0;net45</TargetFrameworks>
39+
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net45</TargetFrameworks>
4540
<DefineConstants Condition="'$(TargetFramework)' == 'net45'">$(DefineConstants);NETFRAMEWORK</DefineConstants>
4641
</PropertyGroup>
4742

UnitTests/App_Packages/Remotion.Development.UnitTesting.Serializer.Sources.1.15.23.0/Serializer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// ReSharper disable once CheckNamespace
2323
namespace Remotion.Development.UnitTesting
2424
{
25+
#if NETFRAMEWORK
2526
/// <summary>
2627
/// Provides quick serialization and deserialization functionality for unit tests.
2728
/// </summary>
@@ -61,4 +62,5 @@ public static object Deserialize (byte[] bytes)
6162
}
6263
}
6364
}
65+
#endif
6466
}

UnitTests/UnitTests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<AssemblyTitle>Unit Tests for Remotion Linq Library SQL Backend</AssemblyTitle>
1212
<AssemblyName>Remotion.Linq.SqlBackend.UnitTests</AssemblyName>
1313
<RootNamespace>$(AssemblyName)</RootNamespace>
14-
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
1514
</PropertyGroup>
1615

1716
<ItemGroup>

UnitTests/UnmappedItemExceptionTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
namespace Remotion.Linq.SqlBackend.UnitTests
2424
{
25+
#if NETFRAMEWORK
2526
[TestFixture]
2627
public class UnmappedItemExceptionTest
2728
{
@@ -37,4 +38,5 @@ public void Serialization ()
3738
Assert.That (deserializedException.InnerException.Message, Is.EqualTo ("inner"));
3839
}
3940
}
41+
#endif
4042
}

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.0",
3+
"version": "9.0.0",
44
"rollForward": "latestFeature",
55
"allowPrerelease": true
66
}

0 commit comments

Comments
 (0)