Skip to content
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
18 changes: 0 additions & 18 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ jobs:
framework: net6.0
runtime: -x64
codecov: true
- os: ubuntu-latest
framework: net5.0
runtime: -x64
codecov: false
- os: macos-latest
framework: net5.0
runtime: -x64
codecov: false
- os: windows-latest
framework: net5.0
runtime: -x64
codecov: false
- os: ubuntu-latest
framework: netcoreapp3.1
runtime: -x64
Expand All @@ -51,10 +39,6 @@ jobs:
framework: netcoreapp3.1
runtime: -x64
codecov: false
- os: windows-latest
framework: netcoreapp2.1
runtime: -x64
codecov: false

runs-on: ${{matrix.options.os}}

Expand Down Expand Up @@ -129,9 +113,7 @@ jobs:
with:
dotnet-version: |
6.0.x
5.0.x
3.1.x
2.1.x

- name: DotNet Build
shell: pwsh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<Choose>
<When Condition="$(SIXLABORS_TESTING) == true">
<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<Choose>
<When Condition="$(SIXLABORS_TESTING) == true">
<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>
Expand All @@ -31,8 +31,7 @@
</ItemGroup>

<ItemGroup>
<!--TODO: Do not upgrade this. Last Version that supports .NET Core 2.1-->
<PackageReference Include="Azure.Storage.Blobs" Version="12.10.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.13.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions src/ImageSharp.Web/Caching/PhysicalFileSystemCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ public class PhysicalFileSystemCache : IImageCache
/// <param name="formatUtilities">Contains various format helper methods based on the current configuration.</param>
public PhysicalFileSystemCache(
IOptions<PhysicalFileSystemCacheOptions> options,
#if NETCOREAPP2_1
IHostingEnvironment environment,
#else
IWebHostEnvironment environment,
#endif
FormatUtilities formatUtilities)
{
Guard.NotNull(options, nameof(options));
Expand Down
20 changes: 3 additions & 17 deletions src/ImageSharp.Web/ImageSharp.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<Choose>
<When Condition="$(SIXLABORS_TESTING) == true">
<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net6.0;netcoreapp3.1;</TargetFrameworks>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>
Expand All @@ -30,22 +30,8 @@
<None Include="..\..\shared-infrastructure\branding\icons\imagesharp.web\sixlabors.imagesharp.web.128.png" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp2.1'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" />
<PackageReference Include="Microsoft.AspNetCore.Http" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" />
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" />
</ItemGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.2.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
</ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions src/ImageSharp.Web/ImageSharpRequestAuthorizationUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
using System.Globalization;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;

#if !NETCOREAPP3_0_OR_GREATER
using Microsoft.AspNetCore.Http.Internal;
#endif

using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Options;
using SixLabors.ImageSharp.Web.Commands;
Expand Down
12 changes: 0 additions & 12 deletions src/ImageSharp.Web/Middleware/ImageSharpMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,19 +449,7 @@ private ValueTask StreamDisposeAsync(Stream stream)
return default;
}

#if NETCOREAPP2_1
try
{
stream.Dispose();
return default;
}
catch (Exception ex)
{
return new ValueTask(Task.FromException(ex));
}
#else
return stream.DisposeAsync();
#endif
}

private async Task<ImageWorkerResult> IsNewOrUpdatedAsync(
Expand Down
8 changes: 0 additions & 8 deletions src/ImageSharp.Web/Providers/PhysicalFileSystemProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ public sealed class PhysicalFileSystemProvider : FileProviderImageProvider
/// <param name="formatUtilities">Contains various format helper methods based on the current configuration.</param>
public PhysicalFileSystemProvider(
IOptions<PhysicalFileSystemProviderOptions> options,
#if NETCOREAPP2_1
IHostingEnvironment environment,
#else
IWebHostEnvironment environment,
#endif
FormatUtilities formatUtilities)
: base(GetProvider(options, environment), options.Value.ProcessingBehavior, formatUtilities)
{
Expand Down Expand Up @@ -58,11 +54,7 @@ internal static string GetProviderRoot(PhysicalFileSystemProviderOptions options

private static PhysicalFileProvider GetProvider(
IOptions<PhysicalFileSystemProviderOptions> options,
#if NETCOREAPP2_1
IHostingEnvironment environment)
#else
IWebHostEnvironment environment)
#endif
{
Guard.NotNull(options, nameof(options));
Guard.NotNull(environment, nameof(environment));
Expand Down
4 changes: 0 additions & 4 deletions src/ImageSharp.Web/Providers/WebRootImageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ public sealed class WebRootImageProvider : FileProviderImageProvider
/// <param name="environment">The web hosting environment.</param>
/// <param name="formatUtilities">Contains various format helper methods based on the current configuration.</param>
public WebRootImageProvider(
#if NETCOREAPP2_1
IHostingEnvironment environment,
#else
IWebHostEnvironment environment,
#endif
FormatUtilities formatUtilities)
: base(environment.WebRootFileProvider, ProcessingBehavior.CommandOnly, formatUtilities)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,8 @@ public RefCountedValue(TValue value, int refCount)
public bool Equals(
#if NET5_0_OR_GREATER
RefCountedValue? other)
#elif NETCOREAPP3_1_OR_GREATER
[System.Diagnostics.CodeAnalysis.AllowNull] RefCountedValue other)
#else
RefCountedValue other)
[System.Diagnostics.CodeAnalysis.AllowNull] RefCountedValue other)
#endif
=> (other != null) && (this.RefCount == other.RefCount) && EqualityComparer<TValue>.Default.Equals(this.Value, other.Value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<AssemblyName>ImageSharp.Web.Benchmarks</AssemblyName>
<RootNamespace>SixLabors.ImageSharp.Web.Benchmarks</RootNamespace>
<GenerateProgramFile>false</GenerateProgramFile>
Expand All @@ -14,8 +14,4 @@
<PackageReference Include="BenchmarkDotNet"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.Http"/>
</ItemGroup>

</Project>
9 changes: 2 additions & 7 deletions tests/ImageSharp.Web.Tests/ImageSharp.Web.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@
<PropertyGroup>
<RootNamespace>SixLabors.ImageSharp.Web.Tests</RootNamespace>
<AssemblyName>SixLabors.ImageSharp.Web.Tests</AssemblyName>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.Http" />
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ private static async Task InitializeAWSStorageAsync(IServiceProvider services, A
}
}

#if NETCOREAPP2_1
IHostingEnvironment environment = services.GetRequiredService<IHostingEnvironment>();
#else
IWebHostEnvironment environment = services.GetRequiredService<IWebHostEnvironment>();
#endif

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ private static void InitializeAzureStorage(IServiceProvider services, AzureBlobS
var container = new BlobContainerClient(containerOptions.ConnectionString, containerOptions.ContainerName);
container.CreateIfNotExists(PublicAccessType.Blob);

#if NETCOREAPP2_1
IHostingEnvironment environment = services.GetRequiredService<IHostingEnvironment>();
#else
IWebHostEnvironment environment = services.GetRequiredService<IWebHostEnvironment>();
#endif

BlobClient blob = container.GetBlobClient(TestConstants.ImagePath);

Expand Down