Skip to content

Commit 76bfc00

Browse files
Merge pull request #103 from ServiceComposer/multi-target-net6-net-7
Multi-target .NET 6 and .NET 7
2 parents ebdc71c + b0c3517 commit 76bfc00

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ jobs:
3131
- name: Setup .NET SDK
3232
uses: actions/[email protected]
3333
with:
34-
dotnet-version: 6.0.x
34+
dotnet-version: |
35+
6.0.x
36+
7.0.x
3537
- name: Build
3638
run: dotnet build src --configuration Release
3739
- name: Tests

src/ServiceComposer.AspNetCore.Testing/SelfContainedWebApplicationFactoryWithHost.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#if NET5_0 || NETCOREAPP
2-
3-
using System;
1+
using System;
42
using Microsoft.AspNetCore.Builder;
53
using Microsoft.AspNetCore.Hosting;
64
using Microsoft.AspNetCore.Mvc.Testing;
@@ -49,5 +47,4 @@ protected override IHostBuilder CreateHostBuilder()
4947
return hostBuilder;
5048
}
5149
}
52-
}
53-
#endif
50+
}

src/ServiceComposer.AspNetCore.Testing/ServiceComposer.AspNetCore.Testing.csproj

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<PropertyGroup>
@@ -21,16 +21,23 @@
2121
</PropertyGroup>
2222

2323
<ItemGroup>
24-
<None Include="..\..\assets\ServiceComposer.png" Pack="true" PackagePath="\"/>
24+
<None Include="..\..\assets\ServiceComposer.png" Pack="true" PackagePath="\" />
2525
</ItemGroup>
26-
26+
2727
<ItemGroup>
28-
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
29-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="[6.0.0, 8.0.0)"/>
28+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
29+
</ItemGroup>
30+
31+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
32+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="[6.0.12, 7.0.0)" />
33+
</ItemGroup>
34+
35+
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
36+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="[7.0.1, 8.0.0)" />
3037
</ItemGroup>
3138

3239
<ItemGroup>
33-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
40+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
3441
</ItemGroup>
3542

3643
<ItemGroup>

0 commit comments

Comments
 (0)