Skip to content

Commit 243dbc7

Browse files
authored
Merge pull request #1131 from LuckyPennySoftware/direct-net4x-support
Adding direct .NET 4.x support
2 parents 1071472 + 4242683 commit 243dbc7

File tree

8 files changed

+27
-42
lines changed

8 files changed

+27
-42
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ on:
55
branches:
66
- master
77
pull_request:
8-
branches:
9-
- master
8+
env:
9+
DOTNET_NOLOGO: true
10+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
11+
MINVERBUILDMETADATA: build.${{ github.run_id }}.${{ github.run_attempt}}
1012
jobs:
1113
build:
1214
runs-on: windows-latest
1315
steps:
1416
- name: Checkout
15-
uses: actions/checkout@v4
17+
uses: actions/checkout@v4.2.0
1618
with:
1719
fetch-depth: 0
20+
filter: tree:0
1821
- name: Setup dotnet
1922
uses: actions/setup-dotnet@v4
2023
with:
@@ -25,6 +28,7 @@ jobs:
2528
run: ./Build.ps1
2629
shell: pwsh
2730
- name: Push to MyGet
31+
if: github.ref == 'refs/heads/master'
2832
env:
2933
NUGET_URL: https://f.feedz.io/lucky-penny-software/mediatr/nuget/index.json
3034
NUGET_API_KEY: ${{ secrets.FEEDZIO_ACCESS_TOKEN }}

.github/workflows/devskim.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
tags:
66
- '*.*.*'
7+
env:
8+
DOTNET_NOLOGO: true
9+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
10+
MINVERBUILDMETADATA: build.${{ github.run_id }}.${{ github.run_attempt}}
711
jobs:
812
build:
913
strategy:
@@ -16,6 +20,7 @@ jobs:
1620
uses: actions/checkout@v4
1721
with:
1822
fetch-depth: 0
23+
filter: tree:0
1924
- name: Setup dotnet
2025
uses: actions/setup-dotnet@v4
2126
with:

Directory.Build.props

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<Project>
22
<PropertyGroup>
3-
<LangVersion>10.0</LangVersion>
3+
<IsMac>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_OSX())))</IsMac>
4+
<IsWindows>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_Windows())))</IsWindows>
5+
6+
<LangVersion>13.0</LangVersion>
47
<NoWarn>$(NoWarn);CS1701;CS1702;CS1591</NoWarn>
58
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
69
</PropertyGroup>

src/MediatR/MediatR.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
2626
</PropertyGroup>
2727

28+
<PropertyGroup Condition=" '$(IsWindows)' == 'true' ">
29+
<TargetFrameworks>$(TargetFrameworks);net462</TargetFrameworks>
30+
</PropertyGroup>
31+
2832
<ItemGroup>
2933
<None Include="..\..\assets\logo\gradient_128x128.png" Pack="true" PackagePath="" />
3034
<None Include="..\..\LICENSE.md" Pack="true" PackagePath=""/>
@@ -45,7 +49,7 @@
4549
<PackageReference Include="MediatR.Contracts" Version="[2.0.1, 3.0.0)" />
4650
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="[8.0.0, )" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
4751
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[8.0.0, )" />
48-
<PackageReference Include="Microsoft.Extensions.Logging" Version="[8.0.0, )" />
52+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[8.0.0, )" />
4953
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="[8.0.1, )" />
5054
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
5155
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="All" />

src/MediatR/MicrosoftExtensionsDI/MediatRServiceCollectionExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using MediatR.Pipeline;
66
using MediatR.Registration;
77
using Microsoft.Extensions.Logging;
8-
using Microsoft.Extensions.Options;
98

109
namespace Microsoft.Extensions.DependencyInjection;
1110

test/MediatR.Tests/GenericRequestHandlerTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace MediatR.Tests
55
{
6+
[Collection(nameof(ServiceFactoryCollectionBehavior))]
67
public class GenericRequestHandlerTests : BaseGenericRequestHandlerTests
78
{
89

test/MediatR.Tests/MediatR.Tests.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework Condition=" '$(OS)' != 'Windows_NT' ">net9.0</TargetFramework>
5-
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net481;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net9.0</TargetFrameworks>
65
<Nullable>enable</Nullable>
76
<NoWarn>$(NoWarn);CS8002;</NoWarn>
87
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
98
<SignAssembly>true</SignAssembly>
109
<AssemblyOriginatorKeyFile>..\..\MediatR.snk</AssemblyOriginatorKeyFile>
1110
</PropertyGroup>
1211

12+
<PropertyGroup Condition=" '$(IsWindows)' == 'true' ">
13+
<TargetFrameworks>$(TargetFrameworks);net462</TargetFrameworks>
14+
</PropertyGroup>
15+
1316
<ItemGroup>
1417
<ProjectReference Include="..\..\src\MediatR\MediatR.csproj"/>
1518
</ItemGroup>

0 commit comments

Comments
 (0)