Skip to content

Commit 958cb78

Browse files
authored
Merge pull request #47 from prom-client-net/chore/drop-netstandard
chore!: drop support for netstandard2.*
2 parents 79ed284 + d857c71 commit 958cb78

File tree

4 files changed

+10
-37
lines changed

4 files changed

+10
-37
lines changed

src/ApplicationBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void AddMetricsHandler(IApplicationBuilder coreapp)
5858

5959
response.ContentType = contentType;
6060

61-
using var outputStream = response.Body;
61+
await using var outputStream = response.Body;
6262
await ScrapeHandler.ProcessAsync(options.CollectorRegistryInstance, outputStream);
6363
});
6464
}

src/Prometheus.Client.AspNetCore.csproj

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<Description>ASP.NET Core middleware for the Prometheus.Client</Description>
4-
<VersionPrefix>4.8.1</VersionPrefix>
5-
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
4+
<VersionPrefix>5.0.0</VersionPrefix>
5+
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
66
<RepositoryUrl>https://github.com/prom-client-net/prom-client-aspnetcore</RepositoryUrl>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
88
</PropertyGroup>
99
<ItemGroup>
10-
<PackageReference Include="Prometheus.Client" Version="[5.0.0,6.0.0)" />
11-
</ItemGroup>
12-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'net6.0'">
1310
<FrameworkReference Include="Microsoft.AspNetCore.App" />
14-
</ItemGroup>
15-
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.1' AND '$(TargetFramework)' != 'net5.0' AND '$(TargetFramework)' != 'net6.0'">
16-
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
17-
<PackageReference Include="System.Text.Encodings.Web" Version="4.5.1" />
11+
<PackageReference Include="Prometheus.Client" Version="[5.2.0,6.0.0)" />
1812
</ItemGroup>
1913
<ItemGroup>
2014
<InternalsVisibleTo Include="$(MSBuildProjectName).Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001008be6f2b28dd255318050634aca9465e8d012e309e1d8165462810ca599355ecc0ec05f67fd8d0dac9dabe6df4636764262c742574fa17eb243862c3349521ecff57153ecd557059560a73b0c5ef3cf1587a763c30acdb9222decb309a9425e29b1ed402398d1312e87947e73e03282d2a66156d6ad2bbf7cf924e349a0e9d59d" />

tests/ApplicationBuilderExtensionsTests.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
using System.Collections.Generic;
33
using System.Text;
44
using Microsoft.AspNetCore.Builder;
5-
6-
#if OLDNETCORE
7-
using Microsoft.AspNetCore.Builder.Internal;
8-
#endif
9-
105
using Microsoft.AspNetCore.Http;
116
using Microsoft.Extensions.DependencyInjection;
127
using Prometheus.Client.Collectors;
Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<!-- netcoreapp2.2 => netstandard2.0 -->
4-
<!-- netcoreapp3.0 => netstandard2.1 -->
5-
<TargetFrameworks>netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
3+
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
64
<IsPackable>false</IsPackable>
75
<InvariantGlobalization>true</InvariantGlobalization>
86
<NoWarn>$(NoWarn);CS0618</NoWarn>
97
</PropertyGroup>
10-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2'">
11-
<PackageReference Include="Microsoft.AspNetCore.App" />
12-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
13-
</ItemGroup>
14-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0' OR '$(TargetFramework)' == 'netcoreapp3.1'">
8+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
159
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.32" />
1610
</ItemGroup>
17-
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
18-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
19-
</ItemGroup>
2011
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
2112
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
2213
</ItemGroup>
14+
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
15+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
16+
</ItemGroup>
2317
<ItemGroup>
2418
<PackageReference Include="coverlet.collector" Version="6.0.0">
2519
<PrivateAssets>all</PrivateAssets>
@@ -29,21 +23,11 @@
2923
<PrivateAssets>all</PrivateAssets>
3024
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3125
</PackageReference>
32-
<PackageReference Include="xunit" Version="2.4.2" />
33-
</ItemGroup>
34-
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp2.2' AND '$(TargetFramework)' != 'netcoreapp3.0'">
3526
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
3627
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
37-
</ItemGroup>
38-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2' OR '$(TargetFramework)' == 'netcoreapp3.0'">
39-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.*" />
40-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
41-
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
28+
<PackageReference Include="xunit" Version="2.4.2" />
4229
</ItemGroup>
4330
<ItemGroup>
4431
<ProjectReference Include="..\src\Prometheus.Client.AspNetCore.csproj" />
4532
</ItemGroup>
46-
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2' OR '$(TargetFramework)' == 'netcoreapp3.0'">
47-
<DefineConstants>$(DefineConstants);OLDNETCORE;</DefineConstants>
48-
</PropertyGroup>
4933
</Project>

0 commit comments

Comments
 (0)