forked from PaulMiami/reCAPTCHA
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Binkus/develop
Update target netcoreapp 2.2 & netstandard 2.0 & Fix RecaptchaOptions.ResponseValidationEndpoint
- Loading branch information
Showing
11 changed files
with
214 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
using System.IO; | ||
using Microsoft.AspNetCore; | ||
using Microsoft.AspNetCore.Hosting; | ||
|
||
namespace TestWebApp | ||
{ | ||
public class Program | ||
public static class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
var host = new WebHostBuilder() | ||
.UseKestrel() | ||
.UseContentRoot(Directory.GetCurrentDirectory()) | ||
.UseIISIntegration() | ||
BuildWebHost(args).Run(); | ||
} | ||
|
||
public static IWebHost BuildWebHost(string[] args) => | ||
WebHost.CreateDefaultBuilder(args) | ||
.UseStartup<Startup>() | ||
.Build(); | ||
|
||
host.Run(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,40 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp1.0</TargetFramework> | ||
<TargetFramework>netcoreapp2.2</TargetFramework> | ||
<PreserveCompilationContext>true</PreserveCompilationContext> | ||
<AssemblyName>TestWebApp</AssemblyName> | ||
<OutputType>Exe</OutputType> | ||
<PackageId>TestWebApp</PackageId> | ||
<UserSecretsId>TestWebApp-45EC5266-9512-4AF0-9BA1-F9C3DC7D57D0</UserSecretsId> | ||
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion> | ||
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;dnxcore50;portable-net45+win8</PackageTargetFallback> | ||
</PropertyGroup> | ||
|
||
<AssetTargetFallback>$(AssetTargetFallback);portable-net47+win8+wp8+wpa81;</AssetTargetFallback> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Update="wwwroot\**\*;Views\**\*"> | ||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<ServerGarbageCollection>true</ServerGarbageCollection> | ||
</PropertyGroup> | ||
|
||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\PaulMiami.AspNetCore.Mvc.Recaptcha\PaulMiami.AspNetCore.Mvc.Recaptcha.csproj" /> | ||
</ItemGroup> | ||
|
||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.2.3" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" Version="2.2.0" PrivateAssets="All" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<ServerGarbageCollection>true</ServerGarbageCollection> | ||
<UserSecretsId>recaptcha-testweb-d2ab3bfe-f40f-4885-850b-9a303a9398ea</UserSecretsId> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.2" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.3" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.0.2" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" /> | ||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.2" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.2" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.2" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.2" /> | ||
</ItemGroup> | ||
|
||
<ProjectReference Include="..\..\src\PaulMiami.AspNetCore.Mvc.Recaptcha\PaulMiami.AspNetCore.Mvc.Recaptcha.csproj" /> | ||
</ItemGroup> | ||
|
||
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish"> | ||
<Exec Command="bower install" /> | ||
</Target> | ||
|
||
</Target> | ||
|
||
<ItemGroup> | ||
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="1.0.0" /> | ||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 44 additions & 44 deletions
88
test/PaulMiami.AspNetCore.Mvc.Recaptcha.Test/PaulMiami.AspNetCore.Mvc.Recaptcha.Test.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,57 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp1.0</TargetFramework> | ||
<TargetFramework>netcoreapp2.2</TargetFramework> | ||
<PreserveCompilationContext>true</PreserveCompilationContext> | ||
<AssemblyName>PaulMiami.AspNetCore.Mvc.Recaptcha.Test</AssemblyName> | ||
<PackageId>PaulMiami.AspNetCore.Mvc.Recaptcha.Test</PackageId> | ||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> | ||
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion> | ||
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;dnxcore50;portable-net45+win8</PackageTargetFallback> | ||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> | ||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> | ||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> | ||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> | ||
</PropertyGroup> | ||
|
||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\PaulMiami.AspNetCore.Mvc.Recaptcha\PaulMiami.AspNetCore.Mvc.Recaptcha.csproj" /> | ||
<ProjectReference Include="..\WebSites\TestSite\TestSite.csproj" /> | ||
</ItemGroup> | ||
|
||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="1.0.3" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> | ||
<PackageReference Include="xunit" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="1.0.3" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Testing" Version="1.2.0-preview1-23565" /> | ||
<PackageReference Include="Moq" Version="4.7.99" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' "> | ||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.2.3" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" /> | ||
<PackageReference Include="Moq" Version="4.10.1" /> | ||
</ItemGroup> | ||
|
||
<!--<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' "> | ||
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<DebugType>full</DebugType> | ||
<DebugSymbols>True</DebugSymbols> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" /> | ||
</ItemGroup> | ||
|
||
<!-- | ||
Found solution at https://github.com/aspnet/Razor/issues/1212 | ||
Work around https://github.com/NuGet/Home/issues/4412. MVC uses DependencyContext.Load() which looks next to a .dll | ||
for a .deps.json. Information isn't available elsewhere. Need the .deps.json file for all web site applications. | ||
--> | ||
<Target Name="CopyDepsFiles" AfterTargets="Build" Condition="'$(TargetFramework)'!=''"> | ||
<ItemGroup> | ||
<DepsFilePaths Include="$([System.IO.Path]::ChangeExtension('%(_ResolvedProjectReferencePaths.FullPath)', '.deps.json'))" /> | ||
</ItemGroup> | ||
|
||
<Copy SourceFiles="%(DepsFilePaths.FullPath)" DestinationFolder="$(OutputPath)" Condition="Exists('%(DepsFilePaths.FullPath)')" /> | ||
</Target> | ||
|
||
</Project> | ||
</ItemGroup>--> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<DebugType>full</DebugType> | ||
<DebugSymbols>True</DebugSymbols> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" /> | ||
</ItemGroup> | ||
|
||
<!-- | ||
Found solution at https://github.com/aspnet/Razor/issues/1212 | ||
Work around https://github.com/NuGet/Home/issues/4412. MVC uses DependencyContext.Load() which looks next to a .dll | ||
for a .deps.json. Information isn't available elsewhere. Need the .deps.json file for all web site applications. | ||
--> | ||
<Target Name="CopyDepsFiles" AfterTargets="Build" Condition="'$(TargetFramework)'!=''"> | ||
<ItemGroup> | ||
<DepsFilePaths Include="$([System.IO.Path]::ChangeExtension('%(_ResolvedProjectReferencePaths.FullPath)', '.deps.json'))" /> | ||
</ItemGroup> | ||
|
||
<Copy SourceFiles="%(DepsFilePaths.FullPath)" DestinationFolder="$(OutputPath)" Condition="Exists('%(DepsFilePaths.FullPath)')" /> | ||
</Target> | ||
|
||
</Project> |
33 changes: 33 additions & 0 deletions
33
test/PaulMiami.AspNetCore.Mvc.Recaptcha.Test/TestLogger.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace PaulMiami.AspNetCore.Mvc.Recaptcha.Test | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.Extensions.Logging; | ||
|
||
public class TestLogger : ILogger, IDisposable | ||
{ | ||
public List<string> Log { get; } = new List<string>(); | ||
public int ScopeCount { get; set; } = 0; | ||
|
||
public void Dispose() | ||
{ | ||
// Method intentionally left empty. | ||
} | ||
|
||
IDisposable ILogger.BeginScope<TState>(TState state) | ||
{ | ||
ScopeCount++; | ||
return this; | ||
} | ||
|
||
bool ILogger.IsEnabled(LogLevel logLevel) | ||
{ | ||
return true; | ||
} | ||
|
||
void ILogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) | ||
{ | ||
Log.Add(formatter(state, exception)); | ||
} | ||
} | ||
} |
Oops, something went wrong.