Skip to content

Commit 2be8b56

Browse files
committed
Add net6.0 and net6.0-windows as targets
1 parent 8bffc63 commit 2be8b56

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

QRCoder/QRCoder.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net35;net40;netstandard1.3;netstandard2.0;net5.0;net5.0-windows</TargetFrameworks>
4+
<TargetFrameworks>net35;net40;netstandard1.3;netstandard2.0;net5.0;net5.0-windows;net6.0;net6.0-windows</TargetFrameworks>
55
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
6-
<UseWindowsForms Condition="'$(TargetFramework)' == 'net5.0-windows'">true</UseWindowsForms>
7-
<UseWPF Condition="'$(TargetFramework)' == 'net5.0-windows'">true</UseWPF>
86
<DefineConstants Condition="'$(TargetFramework)' == 'net5.0-windows'">$(DefineConstants);NET5_0_WINDOWS</DefineConstants>
97
<CheckEolTargetFramework>false</CheckEolTargetFramework>
108
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
@@ -46,7 +44,7 @@
4644
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" />
4745
</ItemGroup>
4846

49-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net5.0' ">
47+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net5.0' or '$(TargetFramework)' == 'net5.0-windows' ">
5048
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
5149
</ItemGroup>
5250

QRCoderTests/ArtQRCodeRendererTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !NETCOREAPP1_1
1+
#if !NETCOREAPP1_1 && !NET6_0
22

33
using Xunit;
44
using QRCoder;

QRCoderTests/PayloadGeneratorTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2675,7 +2675,6 @@ public void one_time_password_generator_hmac_based_generates_with_standard_optio
26752675

26762676
pg.ToString().ShouldBe("otpauth://hotp/Google:[email protected]?secret=pwq65q55&issuer=Google&counter=500");
26772677
}
2678-
//TODO: Include more tests for the one time password payload generator
26792678

26802679

26812680
[Fact]

QRCoderTests/QRCodeRendererTests.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
using System;
1+
#if !NETCOREAPP1_1 && !NET6_0
22
using Xunit;
33
using QRCoder;
44
using Shouldly;
5-
using System.IO;
6-
using System.Security.Cryptography;
75
using QRCoderTests.Helpers.XUnitExtenstions;
86
using QRCoderTests.Helpers;
9-
#if !NETCOREAPP1_1
107
using System.Drawing;
11-
#endif
8+
129

1310
namespace QRCoderTests
1411
{
1512

1613
public class QRCodeRendererTests
1714
{
18-
19-
#if !NETCOREAPP1_1
2015
[Fact]
2116
[Category("QRRenderer/QRCode")]
2217
public void can_create_qrcode_standard_graphic()
@@ -172,6 +167,7 @@ public void can_render_qrcode_from_helper()
172167
var result = HelperFunctions.BitmapToHash(bmp);
173168
result.ShouldBe("e8c61b8f0455924fe08ba68686d0d296");
174169
}
175-
#endif
170+
176171
}
177-
}
172+
}
173+
#endif

QRCoderTests/QRCoderTests.csproj

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net35;net452;netcoreapp1.1;netcoreapp2.0;net5.0;net5.0-windows</TargetFrameworks>
3+
<TargetFrameworks>net35;net452;netcoreapp1.1;netcoreapp2.0;net5.0;net5.0-windows;net6.0;net6.0-windows</TargetFrameworks>
44
<UseWindowsForms Condition="'$(TargetFramework)' == 'net5.0-windows'">true</UseWindowsForms>
55
<UseWPF Condition="'$(TargetFramework)' == 'net5.0-windows'">true</UseWPF>
66
<DefineConstants Condition="'$(TargetFramework)' == 'net5.0-windows'">$(DefineConstants);NET5_0_WINDOWS</DefineConstants>
@@ -9,7 +9,7 @@
99
<CheckEolTargetFramework>false</CheckEolTargetFramework>
1010
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
1111
</PropertyGroup>
12-
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' or '$(TargetFramework)' == 'net5.0-windows' ">
12+
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' or '$(TargetFramework)' == 'net5.0-windows' or '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net6.0-windows' ">
1313
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
1414
<PackageReference Include="xunit" Version="2.4.1" />
1515
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
@@ -27,6 +27,14 @@
2727
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
2828
<PackageReference Include="shouldly" Version="3.0.2" />
2929
</ItemGroup>
30+
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
31+
<Reference Include="PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
32+
<Reference Include="WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
33+
</ItemGroup>
34+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
35+
<Reference Include="PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
36+
<Reference Include="WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
37+
</ItemGroup>
3038
<ItemGroup>
3139
<PackageReference Include="coverlet.collector" Version="3.0.3">
3240
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -37,7 +45,10 @@
3745
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3846
</PackageReference>
3947
<PackageReference Include="SshNet.Security.Cryptography" Version="1.3.0" />
40-
<ProjectReference Include="..\QRCoder\QRCoder.csproj" />
48+
<ProjectReference Include="..\QRCoder\QRCoder.csproj" />
49+
</ItemGroup>
50+
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' or '$(TargetFramework)' == 'net452' or '$(TargetFramework)' == 'net5.0-windows' or '$(TargetFramework)' == 'net6.0-windows' ">
51+
<ProjectReference Include="..\QRCoder.Xaml\QRCoder.Xaml.csproj" />
4152
</ItemGroup>
4253
<ItemGroup>
4354
<None Update="assets\noun_Scientist_2909361.svg">

QRCoderTests/SvgQRCodeRendererTests.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
using System;
1+
#if !NETCOREAPP1_1 && !NET6_0
2+
using System;
23
using Xunit;
34
using QRCoder;
45
using Shouldly;
56
using QRCoderTests.Helpers.XUnitExtenstions;
67
using System.IO;
7-
using System.Security.Cryptography;
88
using QRCoderTests.Helpers;
9-
10-
#if !NETCOREAPP1_1
119
using System.Drawing;
12-
#endif
10+
1311

1412
namespace QRCoderTests
1513
{
1614

1715
public class SvgQRCodeRendererTests
1816
{
1917

20-
#if !NETCOREAPP1_1 && !NETCOREAPP2_0
21-
2218
private string GetAssemblyPath()
2319
{
2420
return
@@ -182,9 +178,9 @@ public void can_render_svg_qrcode_from_helper()
182178
var result = HelperFunctions.StringToHash(svg);
183179
result.ShouldBe("f5ec37aa9fb207e3701cc0d86c4a357d");
184180
}
185-
#endif
186181
}
187182
}
183+
#endif
188184

189185

190186

0 commit comments

Comments
 (0)