Skip to content

Commit e7a2120

Browse files
bannikovileabannikovilea
andauthored
Move to net6 (#8)
* netstandard2.0 * rename to RabbitHost * Modify sql dialects and data providers * modify to net7 and update obsolete packages * remove net7 * Using VS 2019 * Set DesktopFrameworkVersion to net6.0 * Add to hall of fame * Configure githubactions for tests * test branch * Valid sln * Revert "Valid sln" This reverts commit 6fd4fab. * path to sln * Only release configuration * temprorary comment appveyor * Remove appveyor from NuGet.Config --------- Co-authored-by: bannikovilea <[email protected]>
1 parent 90b5b65 commit e7a2120

File tree

16 files changed

+140
-35
lines changed

16 files changed

+140
-35
lines changed

.github/workflows/dotnet-desktop.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# This workflow will build, test, sign and package a WPF or Windows Forms desktop application
7+
# built on .NET Core.
8+
# To learn how to migrate your existing application to .NET Core,
9+
# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
10+
#
11+
# To configure this workflow:
12+
#
13+
# 1. Configure environment variables
14+
# GitHub sets default environment variables for every workflow run.
15+
# Replace the variables relative to your project in the "env" section below.
16+
#
17+
# 2. Signing
18+
# Generate a signing certificate in the Windows Application
19+
# Packaging Project or add an existing signing certificate to the project.
20+
# Next, use PowerShell to encode the .pfx file using Base64 encoding
21+
# by running the following Powershell script to generate the output string:
22+
#
23+
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
24+
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
25+
#
26+
# Open the output file, SigningCertificate_Encoded.txt, and copy the
27+
# string inside. Then, add the string to the repo as a GitHub secret
28+
# and name it "Base64_Encoded_Pfx."
29+
# For more information on how to configure your signing certificate for
30+
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
31+
#
32+
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
33+
# See "Build the Windows Application Packaging project" below to see how the secret is used.
34+
#
35+
# For more information on GitHub Actions, refer to https://github.com/features/actions
36+
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
37+
# refer to https://github.com/microsoft/github-actions-for-desktop-apps
38+
39+
name: .NET Core Desktop
40+
41+
on:
42+
push:
43+
branches: [ "master", "configure-github-actions" ]
44+
pull_request:
45+
branches: [ "master", "configure-github-actions" ]
46+
47+
jobs:
48+
49+
build:
50+
51+
strategy:
52+
matrix:
53+
configuration: [Release]
54+
55+
runs-on: windows-latest # For a list of available runner types, refer to
56+
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
57+
58+
env:
59+
Solution_Name: EasyNetQ.sln
60+
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v3
64+
with:
65+
fetch-depth: 0
66+
67+
# Install the .NET Core workload
68+
- name: Install .NET Core
69+
uses: actions/setup-dotnet@v3
70+
with:
71+
dotnet-version: 6.0.x
72+
73+
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
74+
- name: Setup MSBuild.exe
75+
uses: microsoft/[email protected]
76+
77+
# Execute all unit tests in the solution
78+
- name: Execute unit tests
79+
run: dotnet test ./Source/EasyNetQ.sln

Build/EasyNetQ.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<!-- Properties that are set during build to find test/merge binaries -->
3333
<PropertyGroup>
3434
<Configuration>Release</Configuration>
35-
<DesktopFrameworkVersion>net451</DesktopFrameworkVersion>
35+
<DesktopFrameworkVersion>net6.0</DesktopFrameworkVersion>
3636
<BinaryDesktopFolder>bin\$(Configuration)\$(DesktopFrameworkVersion)</BinaryDesktopFolder>
3737
</PropertyGroup>
3838

Source/EasyNetQ.ExternalScheduler/EasyNetQ.ExternalScheduler.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Description>EasyNetQ.ExternalScheduler</Description>
66
<PackageTags>RabbitMQ;Messaging;AMQP;C#</PackageTags>
77
<PackageIconUrl>https://raw.githubusercontent.com/EasyNetQ/EasyNetQ/gh-pages/design/logo_design.png</PackageIconUrl>
8-
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
8+
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;</TargetFrameworks>
99
<DefineConstants>$(DefineConstants);LIBLOG_PUBLIC;LIBLOG_PORTABLE</DefineConstants>
1010
<DefineConstants>$(DefineConstants);LIBLOG_PUBLIC</DefineConstants>
1111
<LangVersion>7.1</LangVersion>
@@ -25,7 +25,7 @@
2525
<PrivateAssets>all</PrivateAssets>
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
2727
</PackageReference>
28-
<PackageReference Include="GitVersionTask" Version="5.0.1">
28+
<PackageReference Include="GitVersion.MsBuild " Version="5.12.0">
2929
<PrivateAssets>all</PrivateAssets>
3030
</PackageReference>
3131
</ItemGroup>

Source/EasyNetQ.Scheduler.Mongo.Tests/EasyNetQ.Scheduler.Mongo.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />
33
<PropertyGroup>
44
<Description>EasyNetQ.Scheduler.Mongo.Tests</Description>
5-
<TargetFramework>net461</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
</PropertyGroup>
77
<ItemGroup>
88
<ProjectReference Include="..\EasyNetQ.Scheduler.Mongo\EasyNetQ.Scheduler.Mongo.csproj" />
99
</ItemGroup>
1010
<ItemGroup>
1111
<PackageReference Include="EasyNetQ" Version="5.5.0" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
1313
<PackageReference Include="xunit" Version="2.4.1" />
14-
<PackageReference Include="NSubstitute" Version="4.2.2" />
15-
<PackageReference Include="GitVersionTask" Version="5.0.1">
14+
<PackageReference Include="NSubstitute" Version="5.0.0" />
15+
<PackageReference Include="GitVersion.MsBuild " Version="5.12.0">
1616
<PrivateAssets>all</PrivateAssets>
1717
</PackageReference>
1818
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />

Source/EasyNetQ.Scheduler.Mongo/EasyNetQ.Scheduler.Mongo.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />
33
<PropertyGroup>
44
<Description>EasyNetQ.Scheduler.Mongo</Description>
5-
<TargetFramework>net461</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<OutputType>Exe</OutputType>
67
</PropertyGroup>
78
<ItemGroup>
89
<None Update="log4net.config">
@@ -15,12 +16,14 @@
1516
</ItemGroup>
1617
<ItemGroup>
1718
<PackageReference Include="EasyNetQ" Version="5.5.0" />
18-
<PackageReference Include="log4net" Version="2.0.8" />
19-
<PackageReference Include="Topshelf" Version="3.1.4" />
19+
<PackageReference Include="log4net" Version="2.0.15" />
20+
<PackageReference Include="Topshelf" Version="4.3.0" />
2021
<PackageReference Include="MongoDB.Bson" Version="2.8.1" />
2122
<PackageReference Include="mongocsharpdriver" Version="2.8.1" />
22-
<PackageReference Include="GitVersionTask" Version="5.0.1">
23+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
24+
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
2325
<PrivateAssets>all</PrivateAssets>
26+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2427
</PackageReference>
2528
</ItemGroup>
2629
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">

Source/EasyNetQ.Scheduler.Tests/EasyNetQ.Scheduler.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />
33
<PropertyGroup>
44
<Description>EasyNetQ.Scheduler.Tests</Description>
5-
<TargetFramework>net461</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
</PropertyGroup>
77
<ItemGroup>
88
<ProjectReference Include="..\EasyNetQ.ExternalScheduler\EasyNetQ.ExternalScheduler.csproj" />
99
<ProjectReference Include="..\EasyNetQ.Scheduler\EasyNetQ.Scheduler.csproj" />
1010
</ItemGroup>
1111
<ItemGroup>
1212
<PackageReference Include="EasyNetQ" Version="5.5.0" />
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
1414
<PackageReference Include="xunit" Version="2.4.1" />
15-
<PackageReference Include="NSubstitute" Version="4.2.2" />
16-
<PackageReference Include="GitVersionTask" Version="5.0.1">
15+
<PackageReference Include="NSubstitute" Version="5.0.0" />
16+
<PackageReference Include="GitVersion.MsBuild " Version="5.12.0">
1717
<PrivateAssets>all</PrivateAssets>
1818
</PackageReference>
1919
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />

Source/EasyNetQ.Scheduler/ConfigurationBase.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,10 @@ public static bool GetBoolAppSetting(string settingKey)
4040
}
4141
return value;
4242
}
43+
44+
public static string GetConnectionString(string connectionStringName)
45+
{
46+
return ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
47+
}
4348
}
44-
}
49+
}

Source/EasyNetQ.Scheduler/EasyNetQ.Scheduler.csproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />
33
<PropertyGroup>
44
<Description>EasyNetQ.Scheduler</Description>
5-
<TargetFramework>net461</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
<OutputType>Exe</OutputType>
77
</PropertyGroup>
88
<ItemGroup>
@@ -17,13 +17,18 @@
1717
<Reference Include="System.Data" />
1818
</ItemGroup>
1919
<ItemGroup>
20+
<PackageReference Include="Devart.Data.PostgreSql" Version="8.1.134" />
2021
<PackageReference Include="EasyNetQ" Version="5.5.0" />
21-
<PackageReference Include="log4net" Version="2.0.8" />
22+
<PackageReference Include="log4net" Version="2.0.15" />
23+
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.0" />
2224
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
25+
<PackageReference Include="Npgsql" Version="7.0.2" />
2326
<PackageReference Include="RabbitMQ.Client" Version="[6.2.1,6.3.0)" />
24-
<PackageReference Include="Topshelf" Version="4.2.1" />
25-
<PackageReference Include="GitVersionTask" Version="5.0.1">
27+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
28+
<PackageReference Include="Topshelf" Version="4.3.0" />
29+
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
2630
<PrivateAssets>all</PrivateAssets>
31+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2732
</PackageReference>
2833
</ItemGroup>
2934
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">

Source/EasyNetQ.Scheduler/Program.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using log4net.Config;
1+
using System.Data.Common;
2+
using log4net.Config;
3+
using Microsoft.Data.SqlClient;
24
using Topshelf;
35

46
namespace EasyNetQ.Scheduler
@@ -8,6 +10,7 @@ public class Program
810
static void Main()
911
{
1012
XmlConfigurator.Configure();
13+
RegisterDbProviderFactories();
1114

1215
HostFactory.Run(hostConfiguration =>
1316
{
@@ -38,5 +41,12 @@ static void Main()
3841
});
3942
});
4043
}
44+
45+
private static void RegisterDbProviderFactories()
46+
{
47+
DbProviderFactories.RegisterFactory("Microsoft.Data.SqlClient", SqlClientFactory.Instance);
48+
DbProviderFactories.RegisterFactory("Npgsql", Npgsql.NpgsqlFactory.Instance);
49+
DbProviderFactories.RegisterFactory("Devart.Data.PostgreSql", Devart.Data.PostgreSql.PgSqlProviderFactory.Instance);
50+
}
4151
}
4252
}

Source/EasyNetQ.Scheduler/ScheduleRepositoryConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static ScheduleRepositoryConfiguration FromConfigFile()
3939
var providerName = ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName;
4040
return new ScheduleRepositoryConfiguration
4141
{
42-
ProviderName = string.IsNullOrEmpty(providerName) ? "System.Data.SqlClient" : providerName,
42+
ProviderName = string.IsNullOrEmpty(providerName) ? "Microsoft.Data.SqlClient" : providerName,
4343
ConnectionString = connectionString.ConnectionString,
4444
PurgeBatchSize = GetShortAppSetting("PurgeBatchSize"),
4545
PurgeDelayDays = GetIntAppSetting("PurgeDelayDays"),
@@ -50,4 +50,4 @@ public static ScheduleRepositoryConfiguration FromConfigFile()
5050
}
5151

5252
}
53-
}
53+
}

0 commit comments

Comments
 (0)