From c3d312b0b0620bdc92bbda14be889049d96ef17e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sun, 12 Mar 2017 08:12:05 -0700 Subject: [PATCH] Remove net451 as a cross-compile target --- .gitignore | 3 ++- .../Internal/CryptographyAlgorithms.cs | 4 +++- .../Microsoft.AspNetCore.Antiforgery.csproj | 2 +- .../Internal/DefaultClaimUidExtractorTest.cs | 2 +- .../Microsoft.AspNetCore.Antiforgery.Test.csproj | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 980ee002d9..6da3c6a3e9 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,5 @@ node_modules **/[Cc]ompiler/[Rr]esources/**/*.js *launchSettings.json .build/ -.testPublish/ \ No newline at end of file +.testPublish/ +global.json diff --git a/src/Microsoft.AspNetCore.Antiforgery/Internal/CryptographyAlgorithms.cs b/src/Microsoft.AspNetCore.Antiforgery/Internal/CryptographyAlgorithms.cs index 95df639b9c..c466512fee 100644 --- a/src/Microsoft.AspNetCore.Antiforgery/Internal/CryptographyAlgorithms.cs +++ b/src/Microsoft.AspNetCore.Antiforgery/Internal/CryptographyAlgorithms.cs @@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Antiforgery.Internal return sha256; } -#else +#elif NET46 public static SHA256 CreateSHA256() { SHA256 sha256; @@ -33,6 +33,8 @@ namespace Microsoft.AspNetCore.Antiforgery.Internal return sha256; } +#else +#error target frameworks need to be updated. #endif } } diff --git a/src/Microsoft.AspNetCore.Antiforgery/Microsoft.AspNetCore.Antiforgery.csproj b/src/Microsoft.AspNetCore.Antiforgery/Microsoft.AspNetCore.Antiforgery.csproj index 783825919c..0a815abdba 100644 --- a/src/Microsoft.AspNetCore.Antiforgery/Microsoft.AspNetCore.Antiforgery.csproj +++ b/src/Microsoft.AspNetCore.Antiforgery/Microsoft.AspNetCore.Antiforgery.csproj @@ -4,7 +4,7 @@ An antiforgery system for ASP.NET Core designed to generate and validate tokens to prevent Cross-Site Request Forgery attacks. - netstandard1.3;net451 + netstandard1.3;net46 $(NoWarn);CS1591 true aspnetcore;antiforgery diff --git a/test/Microsoft.AspNetCore.Antiforgery.Test/Internal/DefaultClaimUidExtractorTest.cs b/test/Microsoft.AspNetCore.Antiforgery.Test/Internal/DefaultClaimUidExtractorTest.cs index 625984e97f..b03c76e6cc 100644 --- a/test/Microsoft.AspNetCore.Antiforgery.Test/Internal/DefaultClaimUidExtractorTest.cs +++ b/test/Microsoft.AspNetCore.Antiforgery.Test/Internal/DefaultClaimUidExtractorTest.cs @@ -60,7 +60,7 @@ namespace Microsoft.AspNetCore.Antiforgery.Internal identity.AddClaim(new Claim(ClaimTypes.Email, "someone@antifrogery.com")); identity.AddClaim(new Claim(ClaimTypes.GivenName, "some")); identity.AddClaim(new Claim(ClaimTypes.Surname, "one")); -#if NET452 +#if NET46 // CoreCLR doesn't support an 'empty' name identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, string.Empty)); #elif NETCOREAPP2_0 diff --git a/test/Microsoft.AspNetCore.Antiforgery.Test/Microsoft.AspNetCore.Antiforgery.Test.csproj b/test/Microsoft.AspNetCore.Antiforgery.Test/Microsoft.AspNetCore.Antiforgery.Test.csproj index 45f2bb8269..f835c84940 100644 --- a/test/Microsoft.AspNetCore.Antiforgery.Test/Microsoft.AspNetCore.Antiforgery.Test.csproj +++ b/test/Microsoft.AspNetCore.Antiforgery.Test/Microsoft.AspNetCore.Antiforgery.Test.csproj @@ -3,7 +3,7 @@ - netcoreapp2.0;net452 + netcoreapp2.0;net46 netcoreapp2.0 @@ -20,6 +20,7 @@ +