Skip to content

build: Update NET Framework target to 4.8 #271

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

Closed
wants to merge 3 commits into from
Closed
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
9 changes: 4 additions & 5 deletions Yubico.Core/src/Yubico.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License. -->
<RootNamespace></RootNamespace>

<!-- Multi-target build -->
<TargetFrameworks>netstandard2.0;netstandard2.1;net47</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net472</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<!-- Suppressed warnings-->
Expand Down Expand Up @@ -116,18 +116,17 @@ limitations under the License. -->
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.6" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.6" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.6" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<!-- Before updating PolySharp, we should do some due dilligence on the update -->
<PackageReference Include="PolySharp" Version="1.15.0" AllowUpdates="false">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Memory" Version="4.6.3" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
<!-- The wildcard version tag allows us to include the latest minor and pre-release versions -->
<PackageReference Include="Yubico.NativeShims" Version="1.*-*" />
Expand Down
6 changes: 3 additions & 3 deletions Yubico.Core/src/Yubico/PlatformInterop/Libraries.Net47.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ internal static partial class Libraries
/// </exception>
/// <remarks>
/// This method must be called before any P/Invoke calls are made.
/// The implementation details are handled in Libraries.Net47.cs.
/// The implementation details are handled in Libraries.Net48.cs.
/// </remarks>
public static void EnsureInitialized() => Net47Implementation.Initialize();
public static void EnsureInitialized() => Net48Implementation.Initialize();

/// <summary>
/// Encapsulates the .NET Framework 4.7 specific implementation details for native library management.
/// This nested class handles the dynamic loading of architecture-specific (x86/x64) native libraries.
/// </summary>
private static class Net47Implementation
private static class Net48Implementation
{
// Handle to the loaded native library
private static UnmanagedDynamicLibrary? _nativeShims;
Expand Down
2 changes: 1 addition & 1 deletion Yubico.Core/src/Yubico/PlatformInterop/Libraries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// As long as we have the Libraries.Net47.cs class which holds the opposite preprocessor directive check,
// As long as we have the Libraries.Net48.cs class which holds the opposite preprocessor directive check,
// this check is required - as having both at the same time is not possible.
#if !NET47

Expand Down
4 changes: 4 additions & 0 deletions Yubico.NativeShims/Yubico.NativeShims.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<readme>docs/readme.md</readme>
<dependencies>
<group targetFramework=".NETFramework4.7" />
<group targetFramework=".NETFramework4.8" />
<group targetFramework="netstandard2.0" />
</dependencies>
</metadata>
Expand All @@ -34,7 +35,10 @@
<!-- Support files -->
<file src="msbuild/Yubico.NativeShims.targets" target="build/net47/Yubico.NativeShims.targets" />
<file src="msbuild/Yubico.NativeShims.targets" target="buildTransitive/net47/Yubico.NativeShims.targets" />
<file src="msbuild/Yubico.NativeShims.targets" target="build/net48/Yubico.NativeShims.targets" />
<file src="msbuild/Yubico.NativeShims.targets" target="buildTransitive/net48/Yubico.NativeShims.targets" />
<file src="msbuild/_._" target="lib/net47/_._" />
<file src="msbuild/_._" target="lib/net48/_._" />
<file src="msbuild/_._" target="lib/netstandard20/_._" />
<file src="readme.md" target="docs/" />
</files>
Expand Down
12 changes: 6 additions & 6 deletions Yubico.YubiKey/src/Yubico.YubiKey.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License. -->
As of 2020, netstandard2.0 allows us to reach the widest audience while providing a large
enough set of the .NET library to be productive.
-->
<TargetFrameworks>netstandard2.0;netstandard2.1;net47</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net472</TargetFrameworks>

<RootNamespace></RootNamespace>

Expand Down Expand Up @@ -104,12 +104,12 @@ limitations under the License. -->
</ItemGroup>

<ItemGroup Label="Package references specific to Yubico.YubiKey.dll">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.6" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.6" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />

<PackageReference Include="Nullable" Version="1.3.1">
Expand All @@ -125,13 +125,13 @@ limitations under the License. -->
<PackageReference Include="System.Formats.Asn1" Version="9.0.3" />

<!-- Remove ExcludeAssets once the package supports netcoreapp and net462 properly -->
<PackageReference Include="System.Formats.Cbor" Version="7.0.0" ExcludeAssets="buildtransitive" />
<PackageReference Include="System.Formats.Cbor" Version="9.0.6" ExcludeAssets="buildtransitive" />
<ProjectReference Include="..\..\Yubico.Core\src\Yubico.Core.csproj" />

</ItemGroup>

<!-- This is in order to use the HttpUtility.ParseQueryString in .NET47 -->
<ItemGroup Condition="'$(TargetFramework)' == 'net47'">
<!-- This is in order to use the HttpUtility.ParseQueryString in .net472 -->
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<Reference Include="System.Web" />
</ItemGroup>

Expand Down
Loading