Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare repo for .NET 8 #551

Merged
merged 10 commits into from
Sep 25, 2023
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
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
strategy:
matrix:
include:
- os: windows-2019
- os: windows-2022
name: Windows
- os: ubuntu-20.04
- os: ubuntu-22.04
name: Linux
fail-fast: false
steps:
Expand All @@ -28,9 +28,8 @@ jobs:
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: |
7.0.x
6.0.x
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Upload packages
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ env:
DOTNET_NOLOGO: true
jobs:
release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Sign NuGet packages
Expand All @@ -37,4 +38,4 @@ jobs:
uses: Particular/[email protected]
with:
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }}

1 change: 1 addition & 0 deletions .reposync.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
exclusions:
- src/NServiceBus.snk
- src/NServiceBusTests.snk
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,18 @@ This package includes [MongoDB](https://www.mongodb.com/) persistence implementa
- Outbox
- Transactions


## Documentation

Documentation, including configuration, usage, and samples can be found at http://docs.particular.net/persistence/mongodb


## Developing

### Prerequisites

- Projects in this solution require compatible SDKs for the following targets:
- .NET Framework 4.5.2
- .NET Standard 2.0
- Projects in this solution use the new .NET csproj project format which requires .NET Core 2 or greater, which is included in Visual Studio versions 2017 and greater.
- The projects also rely on NuGet for 3rd party dependencies.


### Running tests

Both test projects utilize NUnit. The test projects can be executed using the test runner included in Visual Studio or using the [`dotnet test` command](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test) from the command line.

The tests in the AcceptanceTesting project and many of the tests in the Testing project require an active MongoDB server in order for the test to pass.


#### MongoDB

By default, both the AcceptanceTests and Tests projects will connect to any MongoDB server running at the default address of `mongodb://localhost:27017`.
Expand Down
3 changes: 1 addition & 2 deletions src/Custom.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project>

<PropertyGroup>
<MinVerMinimumMajorMinor>3.1</MinVerMinimumMajorMinor>
<MinVerMinimumMajorMinor>4.0</MinVerMinimumMajorMinor>
<MinVerAutoIncrement>minor</MinVerAutoIncrement>
<LangVersion>10.0</LangVersion>
</PropertyGroup>

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

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -10,11 +10,11 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="MongoDB.Driver" Version="2.19.2" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0-alpha.6" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="MongoDB.Driver" Version="2.19.2" />
</ItemGroup>

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

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -10,11 +10,11 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="MongoDB.Driver" Version="2.19.2" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0-alpha.6" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="MongoDB.Driver" Version="2.19.2" />
</ItemGroup>

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

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -10,11 +10,11 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus.PersistenceTests.Sources" Version="8.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="MongoDB.Driver" Version="2.19.2" />
<PackageReference Include="NServiceBus.PersistenceTests.Sources" Version="9.0.0-alpha.6" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="MongoDB.Driver" Version="2.19.2" />
</ItemGroup>

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

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -10,9 +10,9 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="MongoDB.Driver" Version="2.19.2" />
<PackageReference Include="NServiceBus" Version="8.1.2" />
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.6" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Particular.Approvals" Version="0.5.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ public abstract class NServiceBusAcceptanceTest
[SetUp]
public void SetUp()
{
#if NETFRAMEWORK
// Hack: prevents SerializationException ... Type 'x' in assembly 'y' is not marked as serializable.
// https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/mitigation-deserialization-of-objects-across-app-domains
System.Configuration.ConfigurationManager.GetSection("X");
#endif
Conventions.EndpointNamingConvention = t =>
{
string classAndEndpoint = t.FullName.Split('.').Last();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<!-- We want the root namespace to match the transactional session one -->
<RootNamespace>NServiceBus.TransactionalSession.AcceptanceTests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="8.1.2" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="2.0.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="MongoDB.Driver" Version="2.19.2" />
<ProjectReference Include="..\NServiceBus.Storage.MongoDB.TransactionalSession\NServiceBus.Storage.MongoDB.TransactionalSession.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NServiceBus.Storage.MongoDB.TransactionalSession\NServiceBus.Storage.MongoDB.TransactionalSession.csproj" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="MongoDB.Driver" Version="2.19.2" />
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="9.0.0-alpha.6" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0-alpha.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NServiceBus.Storage.MongoDB.TransactionalSession\NServiceBus.Storage.MongoDB.TransactionalSession.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="Nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.19.2" />
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.6" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0-alpha.1" />
<PackageReference Include="Particular.Approvals" Version="0.5.0" />
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="2.0.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NServiceBus.Storage.MongoDB.TransactionalSession\NServiceBus.Storage.MongoDB.TransactionalSession.csproj" />
</ItemGroup>

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

<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<!-- We want the root namespace to match the transactional session one -->
<RootNamespace>NServiceBus.TransactionalSession</RootNamespace>
<Description>NServiceBus Transactional Session for the MongoDB persistence.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Particular.Packaging" Version="3.0.0" PrivateAssets="All" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="[2.0.0, 3.0.0)" />
<ProjectReference Include="..\NServiceBus.Storage.MongoDB\NServiceBus.Storage.MongoDB.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NServiceBus.Storage.MongoDB\NServiceBus.Storage.MongoDB.csproj" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0-alpha.1" />
<PackageReference Include="Particular.Packaging" Version="3.0.0" PrivateAssets="All" />
</ItemGroup>

</Project>
4 changes: 0 additions & 4 deletions src/NServiceBus.Storage.MongoDB/InternalsVisibleTo.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="[2.19.1, 3.0.0)" />
<PackageReference Include="NServiceBus" Version="[8.0.0, 9.0.0)" />
<PackageReference Include="MongoDB.Driver" Version="[2.19.2, 3.0.0)" />
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.6" />
<PackageReference Include="Particular.Packaging" Version="3.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="NServiceBus.Storage.MongoDB.Tests" />
<InternalsVisibleTo Include="NServiceBus.Storage.MongoDB.PersistenceTests" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ class SubscriptionStorage : Feature
{
public SubscriptionStorage()
{
#pragma warning disable CS0618 // Type or member is obsolete
DependsOn<MessageDrivenSubscriptions>();
#pragma warning restore CS0618 // Type or member is obsolete
DependsOn("NServiceBus.Features.MessageDrivenSubscriptions");
}

protected override void Setup(FeatureConfigurationContext context)
Expand Down
Binary file removed src/NServiceBusTests.snk
Binary file not shown.