Skip to content

Commit

Permalink
add .NET 6.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
secana committed Nov 21, 2021
1 parent 454a6e1 commit bcd781c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/PeNet/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public static List<string> ToHexString(this byte[] input, ulong from, ulong leng
/// <returns>The hex string value as a long.</returns>
public static long ToIntFromHexString(this string hexString)
{
return (long) new Int64Converter().ConvertFromString(hexString);
return (long) (new Int64Converter().ConvertFromString(hexString) ?? throw new InvalidOperationException());
}

/// <summary>
Expand Down
10 changes: 9 additions & 1 deletion src/PeNet/PeNet.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5.0;net48;netstandard2</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net48;netstandard2</TargetFrameworks>
<Version>0.0.0</Version>
<Nullable>enable</Nullable>
<LangVersion>9</LangVersion>
Expand Down Expand Up @@ -52,6 +52,14 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net48|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/PeNet.Test/PeNet.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>disable</Nullable>
</PropertyGroup>
Expand Down

0 comments on commit bcd781c

Please sign in to comment.