Skip to content

Move to net8 #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.302
dotnet-version: 8.0.100
- name: Build with dotnet
run: dotnet build --configuration Release
- name: Run unit tests
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.302
dotnet-version: 8.0.100
- name: Build with dotnet
run: dotnet build --configuration Release
- name: Run unit tests
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.302
dotnet-version: 8.0.100

- name: Clean
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
425 changes: 398 additions & 27 deletions .gitignore

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -6,9 +6,15 @@
<RepositoryType>git</RepositoryType>

<!-- Make sure to update Directory.Build.targets too! -->
<ExeTargetFrameworks>net6.0;net472</ExeTargetFrameworks>
<LibTargetFrameworks>net6.0;netstandard2.0</LibTargetFrameworks>
<ExeTargetFrameworks>net8.0;net472</ExeTargetFrameworks>
<LibTargetFrameworks>net8.0;netstandard2.0</LibTargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<LangVersion>latest</LangVersion>
<Deterministic>true</Deterministic>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

</Project>
25 changes: 0 additions & 25 deletions src/TaglibSharp/CorruptFileException.cs
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@
//

using System;
using System.Runtime.Serialization;

namespace TagLib
{
@@ -98,7 +97,6 @@ namespace TagLib
/// Console.WriteLine ("That file is corrupt: {0}", e.ToString ());
/// </code>
/// </example>
[Serializable]
public class CorruptFileException : Exception
{
/// <summary>
@@ -140,28 +138,5 @@ public CorruptFileException (string message, Exception innerException)
: base (message, innerException)
{
}

/// <summary>
/// Constructs and initializes a new instance of <see
/// cref="CorruptFileException" /> from a specified
/// serialization info and streaming context.
/// </summary>
/// <param name="info">
/// A <see cref="SerializationInfo" /> object containing the
/// serialized data to be used for the new instance.
/// </param>
/// <param name="context">
/// A <see cref="StreamingContext" /> object containing the
/// streaming context information for the new instance.
/// </param>
/// <remarks>
/// This constructor is implemented because <see
/// cref="CorruptFileException" /> implements the <see
/// cref="ISerializable" /> interface.
/// </remarks>
protected CorruptFileException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
}
}
19 changes: 0 additions & 19 deletions src/TaglibSharp/File.cs
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Runtime.Serialization;

namespace TagLib
{
@@ -1299,7 +1298,6 @@ public static File Create (IFileAbstraction abstraction, string mimetype, ReadSt
file.MimeType = mimetype;
return file;
} catch (System.Reflection.TargetInvocationException e) {
PrepareExceptionForRethrow (e.InnerException);
throw e.InnerException;
}
}
@@ -1505,25 +1503,8 @@ protected void Truncate (long length)
Mode = old_mode;
}

/// <summary>
/// Causes the original strack trace of the exception to be preserved when it is rethrown
/// </summary>
/// <param name="ex"></param>
static void PrepareExceptionForRethrow (Exception ex)
{
var ctx = new StreamingContext (StreamingContextStates.CrossAppDomain);
var mgr = new ObjectManager (null, ctx);
var si = new SerializationInfo (ex.GetType (), new FormatterConverter ());

ex.GetObjectData (si, ctx);
mgr.RegisterObject (ex, 1, si); // prepare for SetObjectData
mgr.DoFixups (); // ObjectManager calls SetObjectData
}

#endregion



#region Classes

/// <summary>
27 changes: 0 additions & 27 deletions src/TaglibSharp/Riff/List.cs
Original file line number Diff line number Diff line change
@@ -24,8 +24,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;

namespace TagLib.Riff
{
@@ -34,8 +32,6 @@ namespace TagLib.Riff
/// cref="T:System.Collections.Generic.Dictionary`2" /> to provide
/// support for reading and writing RIFF lists.
/// </summary>
[Serializable]
[ComVisible (false)]
public class List : Dictionary<ByteVector, ByteVectorCollection>
{

@@ -116,29 +112,6 @@ public List (TagLib.File file, long position, int length)
Parse (file.ReadBlock (length));
}

/// <summary>
/// Constructs and initializes a new instance of <see
/// cref="List" /> from a specified serialization info and
/// streaming context.
/// </summary>
/// <param name="info">
/// A <see cref="SerializationInfo" /> object containing the
/// serialized data to be used for the new instance.
/// </param>
/// <param name="context">
/// A <see cref="StreamingContext" /> object containing the
/// streaming context information for the new instance.
/// </param>
/// <remarks>
/// This constructor is implemented because <see
/// cref="List" /> implements the <see cref="ISerializable"
/// /> interface.
/// </remarks>
protected List (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}

#endregion

#region Public Properties
1 change: 0 additions & 1 deletion src/TaglibSharp/TaglibSharp.csproj
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
<SignAssembly>true</SignAssembly>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
27 changes: 1 addition & 26 deletions src/TaglibSharp/UnsupportedFormatException.cs
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@
//

using System;
using System.Runtime.Serialization;

namespace TagLib
{
@@ -93,7 +92,6 @@ namespace TagLib
/// Console.WriteLine ("That file format is not supported: {0}", e.ToString ());
/// </code>
/// </example>
[Serializable]
public class UnsupportedFormatException : Exception
{
/// <summary>
@@ -136,28 +134,5 @@ public UnsupportedFormatException (string message, Exception innerException)
: base (message, innerException)
{
}

/// <summary>
/// Constructs and initializes a new instance of <see
/// cref="UnsupportedFormatException" /> from a specified
/// serialization info and streaming context.
/// </summary>
/// <param name="info">
/// A <see cref="SerializationInfo" /> object containing the
/// serialized data to be used for the new instance.
/// </param>
/// <param name="context">
/// A <see cref="StreamingContext" /> object containing the
/// streaming context information for the new instance.
/// </param>
/// <remarks>
/// This constructor is implemented because <see
/// cref="UnsupportedFormatException" /> implements the <see
/// cref="ISerializable" /> interface.
/// </remarks>
protected UnsupportedFormatException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
}
}
}