Skip to content

Commit 327e70a

Browse files
committed
Remove net462 target
It's now covered by the `netstandard2.0` target.
1 parent 2c7de99 commit 327e70a

File tree

12 files changed

+25
-38
lines changed

12 files changed

+25
-38
lines changed

Annotations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
44

5-
#if NETFRAMEWORK || NETSTANDARD2_0
5+
#if NETSTANDARD2_0
66

77
namespace System.Diagnostics.CodeAnalysis
88
{

Directory.Build.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727

2828
<ItemGroup>
2929
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
30-
31-
<!-- Avoid needing to have targeting packs installed for .NET Framework. -->
32-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
3330
</ItemGroup>
3431

3532
<!-- Analyzers -->

MetadataExtractor.Benchmarks/MetadataExtractor.Benchmarks.csproj

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,4 @@
1313
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
1414
</ItemGroup>
1515

16-
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
17-
<Reference Include="System.Windows" />
18-
<Reference Include="PresentationCore" />
19-
<Reference Include="PresentationFramework" />
20-
<Reference Include="WindowsBase" />
21-
<Reference Include="System.Xaml" />
22-
<Reference Include="System.Drawing" />
23-
<Reference Include="System" />
24-
<Reference Include="Microsoft.CSharp" />
25-
</ItemGroup>
26-
2716
</Project>

MetadataExtractor.Tools.FileProcessor/DeconstructionExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#if NETFRAMEWORK
44

5+
#pragma warning disable IDE0130 // Namespace does not match folder structure
6+
57
namespace System.Collections.Generic;
68

79
internal static class DeconstructionExtensions

MetadataExtractor/Formats/Exif/ExifTiffHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ private bool ProcessMakernote(in TiffReaderContext context, int makernoteOffset)
538538
PushDirectory(new OlympusMakernoteDirectory());
539539
TiffReader.ProcessIfd(this, context, ifdOffset: makernoteOffset);
540540
}
541-
else if (cameraMake is not null && cameraMake.AsSpan().TrimStart().StartsWith("NIKON", StringComparison.OrdinalIgnoreCase))
541+
else if (cameraMake is not null && cameraMake.AsSpan().TrimStart().StartsWith("NIKON".AsSpan(), StringComparison.OrdinalIgnoreCase))
542542
{
543543
if (headerBytes.StartsWith("Nikon"u8))
544544
{

MetadataExtractor/IO/BufferReader.Indexed.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public readonly long GetInt64(int index)
129129
/// <exception cref="IOException"/>
130130
public readonly float GetFloat32(int index)
131131
{
132-
#if NET462 || NETSTANDARD2_0
132+
#if NETSTANDARD2_0
133133
return BitConverter.ToSingle(BitConverter.GetBytes(GetInt32(index)), 0);
134134
#else
135135
Span<byte> bytes = stackalloc byte[4];
@@ -153,7 +153,7 @@ public readonly float GetFloat32(int index)
153153

154154
public readonly double GetDouble64(int index)
155155
{
156-
#if NET462 || NETSTANDARD2_0
156+
#if NETSTANDARD2_0
157157
return BitConverter.Int64BitsToDouble(GetInt64(index));
158158
#else
159159
Span<byte> bytes = stackalloc byte[8];

MetadataExtractor/IO/IndexedCapturingReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void Dispose()
143143

144144
private void GetPosition(int index, out int chunkIndex, out int innerIndex)
145145
{
146-
#if NET462 || NETSTANDARD2_1
146+
#if NETSTANDARD2_1
147147
chunkIndex = Math.DivRem(index, _chunkLength, out innerIndex);
148148
#elif NET6_0_OR_GREATER
149149
(chunkIndex, innerIndex) = Math.DivRem(index, _chunkLength);

MetadataExtractor/IO/IndexedReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public float GetS15Fixed16(int index)
280280
/// <exception cref="IOException"/>
281281
public float GetFloat32(int index)
282282
{
283-
#if NET462 || NETSTANDARD2_0
283+
#if NETSTANDARD2_0
284284
return BitConverter.ToSingle(BitConverter.GetBytes(GetInt32(index)), 0);
285285
#else
286286
Span<byte> bytes = stackalloc byte[4];
@@ -299,7 +299,7 @@ public float GetFloat32(int index)
299299
/// <exception cref="IOException"/>
300300
public double GetDouble64(int index)
301301
{
302-
#if NET462 || NETSTANDARD2_0
302+
#if NETSTANDARD2_0
303303
return BitConverter.Int64BitsToDouble(GetInt64(index));
304304
#else
305305
Span<byte> bytes = stackalloc byte[8];

MetadataExtractor/MetadataExtractor.csproj

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MOV and related QuickTime video formats such as MP4, M4V, 3G2, 3GP are supported
88

99
Camera manufacturer specific support exists for Agfa, Canon, Casio, DJI, Epson, Fujifilm, Kodak, Kyocera, Leica, Minolta, Nikon, Olympus, Panasonic, Pentax, Reconyx, Sanyo, Sigma/Foveon and Sony models.</Description>
1010
<AssemblyTitle>Metadata Extractor</AssemblyTitle>
11-
<TargetFrameworks>$(ModernDotNetTargetFrameworkAlias);netstandard2.0;netstandard2.1;net462</TargetFrameworks>
11+
<TargetFrameworks>$(ModernDotNetTargetFrameworkAlias);netstandard2.0;netstandard2.1</TargetFrameworks>
1212
<NoWarn>$(NoWarn);1591</NoWarn>
1313
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1414
<PackageTags>Metadata;Exif;IPTC;XMP;ICC;Photoshop;WebP;PNG;BMP;ICO;PCX;JPEG;TIFF;PSD;Photography;QuickTime;MOV;MP4;M4V;Video;MP3;WAV;Imaging;Video;Audio</PackageTags>
@@ -17,7 +17,7 @@ Camera manufacturer specific support exists for Agfa, Canon, Casio, DJI, Epson,
1717
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
1818
<PackageReadmeFile>README.md</PackageReadmeFile>
1919

20-
<AllowUnsafeBlocks Condition=" '$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'netstandard2.0' ">true</AllowUnsafeBlocks>
20+
<AllowUnsafeBlocks Condition=" '$(TargetFramework)' == 'netstandard2.0' ">true</AllowUnsafeBlocks>
2121

2222
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2323
</PropertyGroup>
@@ -44,7 +44,7 @@ Camera manufacturer specific support exists for Agfa, Canon, Casio, DJI, Epson,
4444
<PackageReference Include="XmpCore" Version="6.1.10.1" />
4545
</ItemGroup>
4646

47-
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'netstandard2.0' ">
47+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
4848
<PackageReference Include="System.Memory" Version="4.6.3" />
4949
<PackageReference Include="System.ValueTuple" Version="4.6.1" />
5050
</ItemGroup>
@@ -53,14 +53,9 @@ Camera manufacturer specific support exists for Agfa, Canon, Casio, DJI, Epson,
5353
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.5" />
5454
</ItemGroup>
5555

56-
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
57-
<Reference Include="System" />
58-
<Reference Include="Microsoft.CSharp" />
59-
</ItemGroup>
60-
6156
<!-- Analyzers -->
6257
<ItemGroup>
63-
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="4.14.0" PrivateAssets="All" />
58+
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" PrivateAssets="All" />
6459
</ItemGroup>
6560

6661
</Project>

MetadataExtractor/StringValue.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int IConvertible.ToInt32(IFormatProvider? provider)
5656
{
5757
try
5858
{
59-
#if NETSTANDARD2_0 || NETFRAMEWORK
59+
#if NETSTANDARD2_0
6060
return int.Parse(ToString());
6161
#else
6262
if (Bytes.Length < 100)
@@ -95,7 +95,7 @@ uint IConvertible.ToUInt32(IFormatProvider? provider)
9595
{
9696
try
9797
{
98-
#if NETSTANDARD2_0 || NETFRAMEWORK
98+
#if NETSTANDARD2_0
9999
return uint.Parse(ToString());
100100
#else
101101
if (Bytes.Length < 100)

MetadataExtractor/Util/EncodingExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
22

3-
#if NETSTANDARD2_0 || NETFRAMEWORK
3+
#if NETSTANDARD2_0
44

55
internal static class EncodingExtensions
66
{

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ Camera-specific "makernote" data is decoded for cameras manufactured by:
146146
This library targets:
147147

148148
- .NET 8.0 (`net8.0`)
149-
- .NET Framework 4.6.2 (`net462`)
150149
- .NET Standard 2.0 (`netstandard2.0`)
151150
- .NET Standard 2.1 (`netstandard2.1`)
152151

@@ -158,13 +157,18 @@ All target frameworks are provided via the [one NuGet package](https://www.nuget
158157

159158
`netstandard2.1` implements version 2.1 of the .NET Standard, which uses newer APIs where possible.
160159

161-
`net462` targets the full .NET Framework, from version 4.6.2 onwards.
160+
<details>
161+
<summary>Support for older targets in previous versions</summary>
162162

163-
A PCL build was supported until [version 1.5.3](https://www.nuget.org/packages/MetadataExtractor/1.5.3) which supported Silverlight 5.0, Windows 8.0, Windows Phone 8.1 and Windows Phone Silverlight 8.0. PCL versions did not support file-system metadata due to restricted IO APIs.
163+
- A PCL build was supported until [version 1.5.3](https://www.nuget.org/packages/MetadataExtractor/1.5.3) which supported Silverlight 5.0, Windows 8.0, Windows Phone 8.1 and Windows Phone Silverlight 8.0. PCL versions did not support file-system metadata due to restricted IO APIs.
164164

165-
A `net3.5` build was supported until [version 2.8.1](https://www.nuget.org/packages/MetadataExtractor/2.8.1). Support for this framework was dropped in early 2024 to enable use of newer, more efficient, .NET APIs.
165+
- A `netstandard1.3` build was supported until [version 2.8.1](https://www.nuget.org/packages/MetadataExtractor/2.8.1). Support for this framework was dropped in mid 2025 in response to Microsoft advisory [NETSDK1215](https://aka.ms/dotnet/dotnet-standard-guidance) (since .NET SDK 9).
166166

167-
A `netstandard1.3` build was supported until [version 2.8.1](https://www.nuget.org/packages/MetadataExtractor/2.8.1). Support for this framework was dropped in mid 2025 in response to Microsoft advisory [NETSDK1215](https://aka.ms/dotnet/dotnet-standard-guidance) (since .NET SDK 9).
167+
- A `net462` build was supported until [version 2.8.1](https://www.nuget.org/packages/MetadataExtractor/2.8.1). This target became obsolete with the introduction of `netstandard2.0`.
168+
169+
- A `net3.5` build was supported until [version 2.8.1](https://www.nuget.org/packages/MetadataExtractor/2.8.1). Support for this framework was dropped in early 2024 to enable use of newer, more efficient, .NET APIs.
170+
171+
</details>
168172

169173
## Building
170174

0 commit comments

Comments
 (0)