Skip to content

Commit

Permalink
Remove Microsoft.Win32.Registry reference because it is already a par…
Browse files Browse the repository at this point in the history
…t of shared framework

Only keep it when targeting .NET Standard.
Also explicitly add .NET 4.7.1 target framework.
  • Loading branch information
george-chakhidze committed Jul 30, 2023
1 parent ec74b6c commit 2f9ced1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;net471;netstandard2.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
<IsPackable>true</IsPackable>
Expand Down Expand Up @@ -48,11 +48,15 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Registry" Version="5.*" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.*" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.*" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net471' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.*" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace TBC.Common.Configuration.Registry.Tests;
using Microsoft.Win32;
using Xunit;

public class ConfigurationExtensionTest : IDisposable
public sealed class ConfigurationExtensionTest : IDisposable
{
private const string RootKey = @"SOFTWARE\TBC Bank\TBC.Common.Configuration.Registry";
private RegistryKey _registryKey;
Expand Down Expand Up @@ -170,7 +170,5 @@ public void Dispose()
_inventory?.Dispose();
_users?.Dispose();
_registryKey?.Dispose();

GC.SuppressFinalize(this);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFrameworks>net7.0-windows;net6.0-windows;net471</TargetFrameworks>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
Expand Down

0 comments on commit 2f9ced1

Please sign in to comment.