Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4.3.1
with:
dotnet-version: 8.0.x
global-json-file: global.json
- name: Build
run: dotnet build src --configuration Release
- name: Run tests
uses: Particular/run-tests-action@v1.7.0
uses: Particular/run-tests-action@v1.7.0
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"sdk": {
"version": "8.0.400",
"version": "10.0.0",
"allowPrerelease": true,
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion src/Common/Common.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 6 additions & 4 deletions src/Common/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ static void Main(string[] args)
var serializers = new[]
{
Type.GetType("JsonSerializerFacade", true),
#if SYSTEMJSON
Type.GetType("SystemJsonSerializerFacade", true),
#endif
Type.GetType("XmlSerializerFacade", true)
};
var testCases = DiscoverTestCases();

if (args.Contains("Serialize") || args.Length == 0)
if (args.Contains("serialize", StringComparer.OrdinalIgnoreCase) || args.Length == 0)
{
Console.WriteLine("Running Serialization tests for:");
Assert.Multiple(() =>
Expand All @@ -50,7 +53,7 @@ static void Main(string[] args)
});
}

if (args.Contains("Deserialize") || args.Length == 0)
if (args.Contains("deserialize", StringComparer.OrdinalIgnoreCase) || args.Length == 0)
{
Console.WriteLine("Running Deserialization tests for:");
Assert.Multiple(() =>
Expand Down Expand Up @@ -83,8 +86,7 @@ static void DeserializeAndVerify(ISerializerFacade serializer, TestCase testCase
var files = Directory.GetFiles(testCaseFolder);
if (files.Length == 0)
{
throw new Exception(
"No available files to deserialize. Make sure to run the serialization test case first.");
throw new Exception("No available files to deserialize. Make sure to run the serialization test case first.");
}

foreach (var filePath in files)
Expand Down
6 changes: 3 additions & 3 deletions src/Common/Tests/TestCases/TestPolymorphicCollections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public override object CreateInstance() =>

public override void CheckIfAreEqual(object expectedObj, object actualObj)
{
var expected = (Polymorphic)actualObj;
var actual = (Polymorphic)expectedObj;
var expected = (Polymorphic)expectedObj;
var actual = (Polymorphic)actualObj;

Assert.That(actual.Items, Is.EqualTo(expected.Items).AsCollection, "Polymorphic object graph does not match.");
Assert.That(actual.Items, Is.EqualTo(expected.Items), "Polymorphic object graph does not match.");
}
}
}
2 changes: 1 addition & 1 deletion src/Custom.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<LangVersion>12.0</LangVersion>
<LangVersion>preview</LangVersion>
</PropertyGroup>

</Project>
241 changes: 0 additions & 241 deletions src/NServiceBus.Serializers.CompatTests.sln

This file was deleted.

41 changes: 41 additions & 0 deletions src/NServiceBus.Serializers.CompatTests.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path="Custom.Build.props" />
</Folder>
<Project Path="Common/Common.csproj" />
<Project Path="NServiceBus10.0/NServiceBus10.0.csproj" />
<Project Path="NServiceBus3.3/NServiceBus3.3.csproj" />
<Project Path="NServiceBus4.0/NServiceBus4.0.csproj" />
<Project Path="NServiceBus4.1/NServiceBus4.1.csproj" />
<Project Path="NServiceBus4.2/NServiceBus4.2.csproj" />
<Project Path="NServiceBus4.3/NServiceBus4.3.csproj" />
<Project Path="NServiceBus4.4/NServiceBus4.4.csproj" />
<Project Path="NServiceBus4.5/NServiceBus4.5.csproj" />
<Project Path="NServiceBus4.6/NServiceBus4.6.csproj" />
<Project Path="NServiceBus4.7/NServiceBus4.7.csproj" />
<Project Path="NServiceBus5.0/NServiceBus5.0.csproj" />
<Project Path="NServiceBus5.1/NServiceBus5.1.csproj" />
<Project Path="NServiceBus5.2/NServiceBus5.2.csproj" />
<Project Path="NServiceBus6.0/NServiceBus6.0.csproj" />
<Project Path="NServiceBus6.1/NServiceBus6.1.csproj" />
<Project Path="NServiceBus6.2/NServiceBus6.2.csproj" />
<Project Path="NServiceBus6.3/NServiceBus6.3.csproj" />
<Project Path="NServiceBus6.4/NServiceBus6.4.csproj" />
<Project Path="NServiceBus6.5/NServiceBus6.5.csproj" />
<Project Path="NServiceBus7.0/NServiceBus7.0.csproj" />
<Project Path="NServiceBus7.1/NServiceBus7.1.csproj" />
<Project Path="NServiceBus7.2/NServiceBus7.2.csproj" />
<Project Path="NServiceBus7.3/NServiceBus7.3.csproj" />
<Project Path="NServiceBus7.4/NServiceBus7.4.csproj" />
<Project Path="NServiceBus7.5/NServiceBus7.5.csproj" />
<Project Path="NServiceBus7.6/NServiceBus7.6.csproj" />
<Project Path="NServiceBus7.7/NServiceBus7.7.csproj" />
<Project Path="NServiceBus7.8/NServiceBus7.8.csproj" />
<Project Path="NServiceBus8.0/NServiceBus8.0.csproj" />
<Project Path="NServiceBus8.1/NServiceBus8.1.csproj" />
<Project Path="NServiceBus8.2/NServiceBus8.2.csproj" />
<Project Path="NServiceBus9.0/NServiceBus9.0.csproj" />
<Project Path="NServiceBus9.1/NServiceBus9.1.csproj" />
<Project Path="NServiceBus9.2/NServiceBus9.2.csproj" />
<Project Path="Tests/Tests.csproj" />
</Solution>
File renamed without changes.
23 changes: 23 additions & 0 deletions src/NServiceBus10.0/NServiceBus10.0.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus10._0</RootNamespace>
<DefineConstants>SYSTEMJSON</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NServiceBus" Version="10.*-*" />
<PackageReference Include="NServiceBus.Newtonsoft.Json" Version="5.*-*" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\Common\Program.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
using System;
using System;
using System.IO;
using Common;
using Common.Tests;
using Newtonsoft.Json;
using NServiceBus;
using NServiceBus.MessageInterfaces.MessageMapper.Reflection;
using NServiceBus.Serialization;
using NServiceBus.Settings;

class JsonSerializerFacade : ISerializerFacade
class SystemJsonSerializerFacade : ISerializerFacade
{
public JsonSerializerFacade(params Type[] objectTypes)
public SystemJsonSerializerFacade(params Type[] objectTypes)
{
this.objectTypes = objectTypes;
mapper = new MessageMapper();
mapper.Initialize(objectTypes);
var settings = new SettingsHolder();

var jsonSettings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto };
settings.Set("NServiceBus.Newtonsoft.Json.Settings", jsonSettings);
var ser = new NewtonsoftJsonSerializer();
var ser = new SystemJsonSerializer();
serializer = ser.Configure(settings)(mapper);
}

public SerializationFormat SerializationFormat => SerializationFormat.Json;
public SerializationFormat SerializationFormat => SerializationFormat.SystemJson;

public void Serialize(Stream stream, object instance)
{
Expand Down
6 changes: 2 additions & 4 deletions src/NServiceBus7.0/NServiceBus7.0.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus7._0</RootNamespace>
</PropertyGroup>
Expand All @@ -16,9 +16,7 @@
</ItemGroup>

<ItemGroup Label="Direct references to transitive dependencies to avoid versions with CVE">
<PackageReference Include="System.Drawing.Common" Version="4.*" />
<PackageReference Include="System.Private.Uri" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 3 additions & 4 deletions src/NServiceBus7.1/NServiceBus7.1.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus7._1</RootNamespace>
</PropertyGroup>
Expand All @@ -16,10 +16,9 @@
</ItemGroup>

<ItemGroup Label="Direct references to transitive dependencies to avoid versions with CVE">
<PackageReference Include="System.Drawing.Common" Version="4.*" />
<PackageReference Include="System.Private.Uri" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.*-*" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\Common\Program.cs" />
<Compile Include="..\NServiceBus7.0\*.cs" />
Expand Down
6 changes: 2 additions & 4 deletions src/NServiceBus7.2/NServiceBus7.2.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus7._2</RootNamespace>
</PropertyGroup>
Expand All @@ -16,9 +16,7 @@
</ItemGroup>

<ItemGroup Label="Direct references to transitive dependencies to avoid versions with CVE">
<PackageReference Include="System.Drawing.Common" Version="4.*" />
<PackageReference Include="System.Private.Uri" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/NServiceBus7.3/NServiceBus7.3.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus7._3</RootNamespace>
</PropertyGroup>
Expand All @@ -16,8 +16,7 @@
</ItemGroup>

<ItemGroup Label="Direct references to transitive dependencies to avoid versions with CVE">
<PackageReference Include="System.Drawing.Common" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/NServiceBus7.4/NServiceBus7.4.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus7._4</RootNamespace>
</PropertyGroup>
Expand All @@ -16,8 +16,7 @@
</ItemGroup>

<ItemGroup Label="Direct references to transitive dependencies to avoid versions with CVE">
<PackageReference Include="System.Drawing.Common" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/NServiceBus7.5/NServiceBus7.5.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus7._5</RootNamespace>
</PropertyGroup>
Expand All @@ -16,8 +16,7 @@
</ItemGroup>

<ItemGroup Label="Direct references to transitive dependencies to avoid versions with CVE">
<PackageReference Include="System.Drawing.Common" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/NServiceBus7.6/NServiceBus7.6.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus7._6</RootNamespace>
</PropertyGroup>
Expand All @@ -16,8 +16,7 @@
</ItemGroup>

<ItemGroup Label="Direct references to transitive dependencies to avoid versions with CVE">
<PackageReference Include="System.Drawing.Common" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/NServiceBus7.7/NServiceBus7.7.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus7._7</RootNamespace>
</PropertyGroup>
Expand All @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup Label="Direct references to transitive dependencies to avoid versions with CVE">
<PackageReference Include="System.Drawing.Common" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/NServiceBus7.8/NServiceBus7.8.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus7._8</RootNamespace>
</PropertyGroup>
Expand All @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup Label="Direct references to transitive dependencies to avoid versions with CVE">
<PackageReference Include="System.Drawing.Common" Version="4.*" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/NServiceBus8.0/NServiceBus8.0.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>NServiceBus8._0</RootNamespace>
</PropertyGroup>
Expand All @@ -16,8 +16,7 @@
</ItemGroup>

<ItemGroup Label="Direct references to transitive dependencies to avoid versions with CVE">
<PackageReference Include="System.Security.Cryptography.Xml" Version="8.*" />
<PackageReference Include="System.Text.Json" Version="8.*" />
<PackageReference Include="System.Text.Json" Version="10.*-*" Condition="'$(TargetFramework)' == 'net472'" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading