Remove net451 as a cross-compile target

This commit is contained in:
Pranav K 2017-03-12 08:12:05 -07:00
parent f31c302e5c
commit c3d312b0b0
5 changed files with 9 additions and 5 deletions

3
.gitignore vendored
View File

@ -36,4 +36,5 @@ node_modules
**/[Cc]ompiler/[Rr]esources/**/*.js
*launchSettings.json
.build/
.testPublish/
.testPublish/
global.json

View File

@ -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
}
}

View File

@ -4,7 +4,7 @@
<PropertyGroup>
<Description>An antiforgery system for ASP.NET Core designed to generate and validate tokens to prevent Cross-Site Request Forgery attacks.</Description>
<TargetFrameworks>netstandard1.3;net451</TargetFrameworks>
<TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;antiforgery</PackageTags>

View File

@ -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

View File

@ -3,7 +3,7 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
@ -20,6 +20,7 @@
<PackageReference Include="Microsoft.Extensions.WebEncoders" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="System.Security.Claims" Version="$(CoreFxVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
</ItemGroup>