Changes to build in master
* Cleanup bad merge * Update to dotnet-serve that supports arbitrary ports
|
|
@ -3,7 +3,7 @@
|
|||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-serve": {
|
||||
"version": "1.5.0",
|
||||
"version": "1.7.125",
|
||||
"commands": [
|
||||
"dotnet-serve"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
$(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
|
||||
$(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj;
|
||||
$(RepoRoot)src\Components\WebAssembly\Build\testassets\**\*.csproj;
|
||||
$(RepoRoot)src\ProjectTemplates\ComponentsWebAssembly.ProjectTemplates\content\**\*.csproj;
|
||||
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.csproj;
|
||||
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.fsproj;
|
||||
$(RepoRoot)src\ProjectTemplates\Web.Spa.ProjectTemplates\content\**\*.csproj;
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
<ProjectReferenceProvider Include="Microsoft.JSInterop.WebAssembly" ProjectPath="$(RepoRoot)src\Components\WebAssembly\JSInterop\src\Microsoft.JSInterop.WebAssembly.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Components.WebAssembly.Server" ProjectPath="$(RepoRoot)src\Components\WebAssembly\Server\src\Microsoft.AspNetCore.Components.WebAssembly.Server.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" ProjectPath="$(RepoRoot)src\Components\WebAssembly\WebAssembly.Authentication\src\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj" />
|
||||
<ProjectReferenceProvider Include="System.Net.Http.WebAssemblyHttpHandler" ProjectPath="$(RepoRoot)src\Components\WebAssembly\WebAssemblyHttpHandler\src\Microsoft.AspNetCore.Components.WebAssembly.HttpHandler.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Components.WebAssembly" ProjectPath="$(RepoRoot)src\Components\WebAssembly\WebAssembly\src\Microsoft.AspNetCore.Components.WebAssembly.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Testing" ProjectPath="$(RepoRoot)src\Testing\src\Microsoft.AspNetCore.Testing.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore" ProjectPath="$(RepoRoot)src\DefaultBuilder\src\Microsoft.AspNetCore.csproj" RefProjectPath="$(RepoRoot)src\DefaultBuilder\ref\Microsoft.AspNetCore.csproj" />
|
||||
|
|
|
|||
|
|
@ -13,10 +13,6 @@
|
|||
<Uri>https://github.com/dotnet/blazor</Uri>
|
||||
<Sha>cc449601d638ffaab58ae9487f0fd010bb178a12</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Net.Http.Json" Version="3.2.0">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>66409e392d64ed96e5d3a5fda712d9baf51196ed</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="dotnet-ef" Version="5.0.0-preview.6.20276.2">
|
||||
<Uri>https://github.com/dotnet/efcore</Uri>
|
||||
<Sha>46636e00447b1303e1ea439b68bfada1cdcb8393</Sha>
|
||||
|
|
@ -209,6 +205,10 @@
|
|||
<Uri>https://github.com/dotnet/runtime</Uri>
|
||||
<Sha>c44dc40b763b7c74012622a0a6120cd8ffa35ce4</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Net.Http.Json" Version="5.0.0-preview.6.20271.10">
|
||||
<Uri>https://github.com/dotnet/runtime</Uri>
|
||||
<Sha>66409e392d64ed96e5d3a5fda712d9baf51196ed</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Net.Http.WinHttpHandler" Version="5.0.0-preview.6.20271.10">
|
||||
<Uri>https://github.com/dotnet/runtime</Uri>
|
||||
<Sha>c44dc40b763b7c74012622a0a6120cd8ffa35ce4</Sha>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
<!-- Servicing builds have different characteristics for the way dependencies, baselines, and versions are handled. -->
|
||||
<IsServicingBuild Condition=" '$(DisableServicingFeatures)' != 'true' AND '$(PreReleaseVersionLabel)' == 'servicing' ">true</IsServicingBuild>
|
||||
<VersionPrefix>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion)</VersionPrefix>
|
||||
<ComponentsWebAssemblyVersionPrefix>$(ComponentsWebAssemblyMajorVersion).$(ComponentsWebAssemblyMinorVersion).$(ComponentsWebAssemblyPatchVersion)</ComponentsWebAssemblyVersionPrefix>
|
||||
<!-- TargetingPackVersionPrefix is used by projects, like .deb and .rpm, which use slightly different version formats. -->
|
||||
<TargetingPackVersionPrefix>$(VersionPrefix)</TargetingPackVersionPrefix>
|
||||
<!-- Targeting packs do not produce patch versions in servicing builds. No API changes are allowed in patches. -->
|
||||
|
|
@ -112,6 +111,7 @@
|
|||
<SystemDiagnosticsEventLogPackageVersion>5.0.0-preview.6.20271.10</SystemDiagnosticsEventLogPackageVersion>
|
||||
<SystemDrawingCommonPackageVersion>5.0.0-preview.6.20271.10</SystemDrawingCommonPackageVersion>
|
||||
<SystemIOPipelinesPackageVersion>5.0.0-preview.6.20271.10</SystemIOPipelinesPackageVersion>
|
||||
<SystemNetHttpJsonPackageVersion>5.0.0-preview.6.20271.10</SystemNetHttpJsonPackageVersion>
|
||||
<SystemNetHttpWinHttpHandlerPackageVersion>5.0.0-preview.6.20271.10</SystemNetHttpWinHttpHandlerPackageVersion>
|
||||
<SystemNetWebSocketsWebSocketProtocolPackageVersion>5.0.0-preview.6.20271.10</SystemNetWebSocketsWebSocketProtocolPackageVersion>
|
||||
<SystemReflectionMetadataPackageVersion>5.0.0-preview.6.20271.10</SystemReflectionMetadataPackageVersion>
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
|
|||
if ($msbuildCmd -ne $null) {
|
||||
# Workaround for https://github.com/dotnet/roslyn/issues/35793
|
||||
# Due to this issue $msbuildCmd.Version returns 0.0.0.0 for msbuild.exe 16.2+
|
||||
$msbuildVersion = [Version]::new((Get-Item $msbuildCmd.Path).VersionInfo.ProductVersion.Split(@('-', '+'))[0])
|
||||
$msbuildVersion = [Version]::new((Get-Item $msbuildCmd.Path).VersionInfo.ProductVersion.Split([char[]]@('-', '+'))[0])
|
||||
|
||||
if ($msbuildVersion -ge $vsMinVersion) {
|
||||
return $global:_MSBuildExe = $msbuildCmd.Path
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ try {
|
|||
| ? {
|
||||
# These .sln files are used by the templating engine.
|
||||
($_.Name -ne "BlazorServerWeb_CSharp.sln") -and
|
||||
($_.Name -ne "BlazorWasm-CSharp.sln")
|
||||
($_.Name -ne "ComponentsWebAssembly-CSharp.sln")
|
||||
} `
|
||||
| % {
|
||||
Write-Host " Checking $(Split-Path -Leaf $_)"
|
||||
|
|
|
|||
|
|
@ -11,6 +11,12 @@
|
|||
],
|
||||
"dotnet/x86": [
|
||||
"$(MicrosoftNETCoreAppInternalPackageVersion)"
|
||||
],
|
||||
"aspnetcore/x64": [
|
||||
"3.1.0"
|
||||
],
|
||||
"aspnetcore/x86": [
|
||||
"3.1.0"
|
||||
]
|
||||
},
|
||||
"Git": "2.22.0",
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@
|
|||
<MSBuild
|
||||
Projects="..\..\Compression\src\Microsoft.AspNetCore.Components.WebAssembly.Build.BrotliCompression.csproj"
|
||||
Targets="Publish"
|
||||
Properties="Configuration=$(Configuration);TargetFramework=netcoreapp3.1;PublishDir=$(_BrotliToolsOutputPath)">
|
||||
Properties="Configuration=$(Configuration);TargetFramework=$(DefaultNetCoreTargetFramework);PublishDir=$(_BrotliToolsOutputPath)">
|
||||
</MSBuild>
|
||||
|
||||
</Target>
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
{
|
||||
// Arrange
|
||||
using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "standalone", "razorclasslibrary" });
|
||||
project.TargetFramework = "netcoreapp3.1";
|
||||
project.TargetFramework = TestFacts.DefaultNetCoreTargetFramework;
|
||||
var result = await MSBuildProcessManager.DotnetMSBuild(project, target: "publish");
|
||||
|
||||
Assert.BuildPassed(result);
|
||||
|
|
@ -260,7 +260,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
{
|
||||
// Arrange
|
||||
using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "standalone", "razorclasslibrary" });
|
||||
project.TargetFramework = "netcoreapp3.1";
|
||||
project.TargetFramework = TestFacts.DefaultNetCoreTargetFramework;
|
||||
var result = await MSBuildProcessManager.DotnetMSBuild(project, target: "publish", args: "/p:BlazorWebAssemblyEnableLinking=false");
|
||||
|
||||
Assert.BuildPassed(result);
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
{
|
||||
// Arrange
|
||||
using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "standalone", "razorclasslibrary", });
|
||||
project.TargetFramework = "netcoreapp3.1";
|
||||
project.TargetFramework = TestFacts.DefaultNetCoreTargetFramework;
|
||||
var result = await MSBuildProcessManager.DotnetMSBuild(project);
|
||||
|
||||
Assert.BuildPassed(result);
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
|
||||
static void SetupDirectoryBuildFiles(string repoRoot, string testAppsRoot, string projectDestination)
|
||||
{
|
||||
var razorSdkDirectoryRoot = Assembly.GetExecutingAssembly().GetCustomAttributes<AssemblyMetadataAttribute>().SingleOrDefault(a => a.Key == "RazorSdkDirectoryRoot").Value;
|
||||
var razorSdkDirectoryRoot = TestFacts.RazorSdkDirectoryRoot;
|
||||
var beforeDirectoryPropsContent =
|
||||
$@"<Project>
|
||||
<PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
{
|
||||
// Arrange
|
||||
using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "standalone", "razorclasslibrary", });
|
||||
project.TargetFramework = "netcoreapp3.1";
|
||||
project.TargetFramework = TestFacts.DefaultNetCoreTargetFramework;
|
||||
var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish");
|
||||
AddSiblingProjectFileContent(project, @"
|
||||
<PropertyGroup>
|
||||
|
|
@ -337,7 +337,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
{
|
||||
// Arrange
|
||||
using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "standalone", "razorclasslibrary", });
|
||||
project.TargetFramework = "netcoreapp3.1";
|
||||
project.TargetFramework = TestFacts.DefaultNetCoreTargetFramework;
|
||||
|
||||
AddSiblingProjectFileContent(project, @"
|
||||
<PropertyGroup>
|
||||
|
|
@ -396,7 +396,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
{
|
||||
// Arrange
|
||||
using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "standalone", "razorclasslibrary", });
|
||||
project.TargetFramework = "netcoreapp3.1";
|
||||
project.TargetFramework = TestFacts.DefaultNetCoreTargetFramework;
|
||||
var result = await MSBuildProcessManager.DotnetMSBuild(project, "Build");
|
||||
|
||||
Assert.BuildPassed(result);
|
||||
|
|
@ -438,7 +438,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
// Simulates publishing the same way VS does by setting BuildProjectReferences=false.
|
||||
// Arrange
|
||||
using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "standalone", "razorclasslibrary", });
|
||||
project.TargetFramework = "netcoreapp3.1";
|
||||
project.TargetFramework = TestFacts.DefaultNetCoreTargetFramework;
|
||||
project.Configuration = "Release";
|
||||
var result = await MSBuildProcessManager.DotnetMSBuild(project, "Build", "/p:BuildInsideVisualStudio=true");
|
||||
|
||||
|
|
@ -483,7 +483,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
// Simulates publishing the same way VS does by setting BuildProjectReferences=false.
|
||||
// Arrange
|
||||
var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "standalone", "razorclasslibrary", "classlibrarywithsatelliteassemblies" });
|
||||
project.TargetFramework = "netcoreapp3.1";
|
||||
project.TargetFramework = TestFacts.DefaultNetCoreTargetFramework;
|
||||
project.Configuration = "Release";
|
||||
var standaloneProjectDirectory = Path.Combine(project.DirectoryPath, "..", "standalone");
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
||||
{
|
||||
public static class TestFacts
|
||||
{
|
||||
public static string DefaultNetCoreTargetFramework =>
|
||||
GetAttributeValue(nameof(DefaultNetCoreTargetFramework));
|
||||
|
||||
public static string RazorSdkDirectoryRoot =>
|
||||
GetAttributeValue(nameof(RazorSdkDirectoryRoot));
|
||||
|
||||
private static string GetAttributeValue(string name)
|
||||
{
|
||||
return Assembly
|
||||
.GetExecutingAssembly()
|
||||
.GetCustomAttributes<AssemblyMetadataAttribute>()
|
||||
.FirstOrDefault(a => a.Key == $"Testing.{name}")
|
||||
.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
|
|
@ -28,7 +28,6 @@
|
|||
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Runtime" />
|
||||
<Reference Include="Microsoft.Build.Framework" />
|
||||
<Reference Include="Microsoft.Build.Utilities.Core" />
|
||||
<Reference Include="Microsoft.Extensions.CommandLineUtils.Sources" />
|
||||
<!-- Avoid CS1705 errors due to mix of assemblies brought in transitively. -->
|
||||
<Reference Include="Microsoft.AspNetCore.Components" />
|
||||
</ItemGroup>
|
||||
|
|
@ -46,7 +45,7 @@
|
|||
</AssemblyAttribute>
|
||||
|
||||
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
|
||||
<_Parameter1>RazorSdkDirectoryRoot</_Parameter1>
|
||||
<_Parameter1>Testing.RazorSdkDirectoryRoot</_Parameter1>
|
||||
<_Parameter2>$(ArtifactsBinDir)Microsoft.NET.Sdk.Razor\$(Configuration)\sdk-output\</_Parameter2>
|
||||
</AssemblyAttribute>
|
||||
|
||||
|
|
@ -54,6 +53,11 @@
|
|||
<_Parameter1>Testing.MicrosoftAspNetCoreComponentsWebAssemblyRuntimePackageVersion</_Parameter1>
|
||||
<_Parameter2>$(MicrosoftAspNetCoreComponentsWebAssemblyRuntimePackageVersion)</_Parameter2>
|
||||
</AssemblyAttribute>
|
||||
|
||||
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
|
||||
<_Parameter1>Testing.DefaultNetCoreTargetFramework</_Parameter1>
|
||||
<_Parameter2>$(DefaultNetCoreTargetFramework)</_Parameter2>
|
||||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="RestoreTestAssets" AfterTargets="Restore;Build" Condition="'$(DotNetBuildFromSource)' != 'true'">
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Testing.xunit;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
||||
|
|
@ -43,13 +44,9 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
uncalled implementation code from mscorlib.dll anyway.
|
||||
*/
|
||||
"Microsoft.AspNetCore.Components.dll",
|
||||
"Microsoft.AspNetCore.Components.pdb",
|
||||
"Microsoft.AspNetCore.Components.Forms.dll",
|
||||
"Microsoft.AspNetCore.Components.Forms.pdb",
|
||||
"Microsoft.AspNetCore.Components.Web.dll",
|
||||
"Microsoft.AspNetCore.Components.Web.pdb",
|
||||
"Microsoft.AspNetCore.Components.WebAssembly.dll",
|
||||
"Microsoft.AspNetCore.Components.WebAssembly.pdb",
|
||||
"Microsoft.Bcl.AsyncInterfaces.dll",
|
||||
"Microsoft.Extensions.Configuration.Abstractions.dll",
|
||||
"Microsoft.Extensions.Configuration.dll",
|
||||
|
|
@ -66,12 +63,10 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
"Microsoft.Extensions.Primitives.dll",
|
||||
"Microsoft.JSInterop.dll",
|
||||
"Microsoft.JSInterop.WebAssembly.dll",
|
||||
"Microsoft.JSInterop.WebAssembly.pdb",
|
||||
"Mono.Security.dll",
|
||||
"mscorlib.dll",
|
||||
"netstandard.dll",
|
||||
"StandaloneApp.dll",
|
||||
"StandaloneApp.pdb",
|
||||
"System.dll",
|
||||
"System.Buffers.dll",
|
||||
"System.ComponentModel.Annotations.dll",
|
||||
|
|
@ -113,6 +108,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Build
|
|||
|
||||
var contents = paths
|
||||
.Select(p => Path.GetFileName(p))
|
||||
.Where(p => Path.GetExtension(p) != ".pdb")
|
||||
.OrderBy(i => i, StringComparer.Ordinal)
|
||||
.ToArray();
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
<AssemblyName>blazor-brotli</AssemblyName>
|
||||
<IsShippingPackage>false</IsShippingPackage>
|
||||
<HasReferenceAssembly>false</HasReferenceAssembly>
|
||||
<MicrosoftNETCoreAppRuntimeVersion>3.1.0</MicrosoftNETCoreAppRuntimeVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -12,10 +12,13 @@
|
|||
<NoWarn>$(NoWarn);CS0649</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AspNetCore" />
|
||||
<Reference Include="Microsoft.AspNetCore.WebSockets" />
|
||||
<Reference Include="Microsoft.Extensions.CommandLineUtils.Sources" />
|
||||
<Reference Include="Microsoft.Extensions.Hosting" />
|
||||
|
||||
<!-- Dependencies of ws-proxy sources -->
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
<Reference Include="Microsoft.AspNetCore.Components.Server" />
|
||||
<Reference Include="Microsoft.AspNetCore.ResponseCompression" />
|
||||
<Reference Include="Microsoft.AspNetCore" />
|
||||
<Reference Include="Microsoft.Extensions.Hosting" />
|
||||
|
||||
<Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
|
||||
<Reference Include="Microsoft.Extensions.Hosting" />
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
<Project>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
|
||||
<PropertyGroup>
|
||||
<!-- Override version labels -->
|
||||
<VersionPrefix>$(ComponentsWebAssemblyVersionPrefix)</VersionPrefix>
|
||||
|
||||
<!-- Avoid source build issues with WebAssembly -->
|
||||
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
<NoWarn>$(NoWarn);BL0005;BL0006</NoWarn>
|
||||
<!-- Avoid CS1705 errors due to mix of assemblies brought in transitively. -->
|
||||
<CompileUsingReferenceAssemblies>false</CompileUsingReferenceAssemblies>
|
||||
|
|
|
|||
|
|
@ -11,9 +11,16 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AspNetCore.Components.Web" />
|
||||
<Reference Include="Microsoft.Extensions.Configuration.Json" />
|
||||
<Reference Include="Microsoft.Extensions.Configuration.Binder" />
|
||||
<Reference Include="Microsoft.Extensions.Logging" />
|
||||
<Reference Include="Microsoft.JSInterop.WebAssembly" />
|
||||
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly.HttpHandler" IncludeAssets="compile" />
|
||||
|
||||
<!-- Tracking removing using https://github.com/dotnet/aspnetcore/issues/22283 -->
|
||||
<ProjectReference
|
||||
Include="..\..\WebAssemblyHttpHandler\src\Microsoft.AspNetCore.Components.WebAssembly.HttpHandler.csproj"
|
||||
IncludeAssets="compile" />
|
||||
|
||||
<SuppressBaselineReference Include="Microsoft.AspNetCore.Components.WebAssembly.HttpHandler" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
<AssemblyVersion>0.2.2.0</AssemblyVersion>
|
||||
<ProduceOnlyReferenceAssembly>true</ProduceOnlyReferenceAssembly>
|
||||
<StrongNameKeyId>Open</StrongNameKeyId>
|
||||
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AspNetCore" />
|
||||
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
|
||||
<Reference Include="Microsoft.Extensions.Hosting" />
|
||||
<Reference Include="Microsoft.Extensions.Hosting" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,23 @@
|
|||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/node@^13.1.7":
|
||||
version "13.13.9"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.9.tgz#79df4ae965fb76d31943b54a6419599307a21394"
|
||||
integrity sha512-EPZBIGed5gNnfWCiwEIwTE2Jdg4813odnG8iNPMQGrqVxrI+wL68SPtPeCX+ZxGBaA6pKAVc6jaKgP/Q0QzfdQ==
|
||||
|
||||
adm-zip@~0.4.3:
|
||||
version "0.4.14"
|
||||
resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.14.tgz#2cf312bcc9f8875df835b0f6040bd89be0a727a9"
|
||||
integrity sha512-/9aQCnQHF+0IiCl0qhXoK7qs//SwYE7zX8lsr/DNk1BRAHYxeLZPL4pguwK29gUEqasYQjqPtEpDRSWEkdHn9g==
|
||||
|
||||
agent-base@6:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.0.tgz#5d0101f19bbfaed39980b22ae866de153b93f09a"
|
||||
integrity sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==
|
||||
dependencies:
|
||||
debug "4"
|
||||
|
||||
ajv@^6.5.5:
|
||||
version "6.10.2"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52"
|
||||
|
|
@ -12,6 +29,11 @@ ajv@^6.5.5:
|
|||
json-schema-traverse "^0.4.1"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
arg@^4.1.0:
|
||||
version "4.1.3"
|
||||
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
|
||||
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
|
||||
|
||||
asn1@~0.2.3:
|
||||
version "0.2.4"
|
||||
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
|
||||
|
|
@ -24,7 +46,7 @@ assert-plus@1.0.0, assert-plus@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
|
||||
integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=
|
||||
|
||||
async@^2.6.2:
|
||||
async@^2.1.2, async@^2.6.2:
|
||||
version "2.6.3"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
|
||||
integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
|
||||
|
|
@ -46,6 +68,11 @@ aws4@^1.8.0:
|
|||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
|
||||
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
||||
|
||||
bcrypt-pbkdf@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
|
||||
|
|
@ -61,11 +88,24 @@ bl@^2.2.0:
|
|||
readable-stream "^2.3.5"
|
||||
safe-buffer "^5.1.1"
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
buffer-crc32@~0.2.3:
|
||||
version "0.2.13"
|
||||
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
|
||||
integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=
|
||||
|
||||
buffer-from@^1.0.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
||||
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
|
||||
|
||||
caseless@~0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
|
||||
|
|
@ -83,6 +123,11 @@ commander@^2.19.0:
|
|||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
|
||||
integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
|
||||
|
||||
core-util-is@1.0.2, core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
|
|
@ -106,7 +151,7 @@ dashdash@^1.12.0:
|
|||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
debug@^4.1.1:
|
||||
debug@4, debug@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
|
||||
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
|
||||
|
|
@ -118,6 +163,11 @@ delayed-stream@~1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
|
||||
|
||||
diff@^4.0.1:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
|
||||
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
|
||||
|
||||
ecc-jsbn@~0.1.1:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
|
||||
|
|
@ -184,6 +234,11 @@ fs-constants@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
|
||||
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
|
||||
|
||||
getpass@^0.1.1:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
|
||||
|
|
@ -191,6 +246,18 @@ getpass@^0.1.1:
|
|||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
glob@^7.1.3:
|
||||
version "7.1.6"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
|
||||
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.0.4"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
har-schema@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
|
||||
|
|
@ -213,7 +280,23 @@ http-signature@~1.2.0:
|
|||
jsprim "^1.2.2"
|
||||
sshpk "^1.7.0"
|
||||
|
||||
inherits@^2.0.3, inherits@~2.0.3:
|
||||
https-proxy-agent@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2"
|
||||
integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==
|
||||
dependencies:
|
||||
agent-base "6"
|
||||
debug "4"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2, inherits@^2.0.3, inherits@~2.0.3:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
|
@ -268,11 +351,21 @@ jsprim@^1.2.2:
|
|||
json-schema "0.2.3"
|
||||
verror "1.10.0"
|
||||
|
||||
lodash@^4.16.6:
|
||||
version "4.17.15"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
|
||||
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
|
||||
|
||||
lodash@^4.17.11, lodash@^4.17.14:
|
||||
version "4.17.14"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba"
|
||||
integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==
|
||||
|
||||
make-error@^1.1.1:
|
||||
version "1.3.6"
|
||||
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
|
||||
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
|
||||
|
||||
mime-db@1.40.0:
|
||||
version "1.40.0"
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32"
|
||||
|
|
@ -285,6 +378,13 @@ mime-types@^2.1.12, mime-types@~2.1.19:
|
|||
dependencies:
|
||||
mime-db "1.40.0"
|
||||
|
||||
minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimist@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||
|
|
@ -317,13 +417,18 @@ oauth-sign@~0.9.0:
|
|||
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
|
||||
integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
|
||||
|
||||
once@^1.4.0:
|
||||
once@^1.3.0, once@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
|
||||
|
||||
path-key@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
|
||||
|
|
@ -417,6 +522,13 @@ request@2.88.0:
|
|||
tunnel-agent "^0.6.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
rimraf@^2.5.4:
|
||||
version "2.7.1"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
|
||||
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
|
||||
dependencies:
|
||||
glob "^7.1.3"
|
||||
|
||||
safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519"
|
||||
|
|
@ -432,6 +544,17 @@ safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
|
|||
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
||||
|
||||
sauce-connect-launcher@^1.3.1:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.3.2.tgz#dfc675a258550809a8eaf457eb9162b943ddbaf0"
|
||||
integrity sha512-wf0coUlidJ7rmeClgVVBh6Kw55/yalZCY/Un5RgjSnTXRAeGqagnTsTYpZaqC4dCtrY4myuYpOAZXCdbO7lHfQ==
|
||||
dependencies:
|
||||
adm-zip "~0.4.3"
|
||||
async "^2.1.2"
|
||||
https-proxy-agent "^5.0.0"
|
||||
lodash "^4.16.6"
|
||||
rimraf "^2.5.4"
|
||||
|
||||
selenium-standalone@^6.17.0:
|
||||
version "6.17.0"
|
||||
resolved "https://registry.yarnpkg.com/selenium-standalone/-/selenium-standalone-6.17.0.tgz#0f24b691836205ee9bc3d7a6f207ebcb28170cd9"
|
||||
|
|
@ -468,6 +591,19 @@ shebang-regex@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
|
||||
integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
|
||||
|
||||
source-map-support@^0.5.17:
|
||||
version "0.5.19"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
|
||||
integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
|
||||
dependencies:
|
||||
buffer-from "^1.0.0"
|
||||
source-map "^0.6.0"
|
||||
|
||||
source-map@^0.6.0:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
|
||||
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
|
||||
|
||||
sshpk@^1.7.0:
|
||||
version "1.16.1"
|
||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877"
|
||||
|
|
@ -516,6 +652,17 @@ tough-cookie@~2.4.3:
|
|||
psl "^1.1.24"
|
||||
punycode "^1.4.1"
|
||||
|
||||
ts-node@^8.6.2:
|
||||
version "8.10.1"
|
||||
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.10.1.tgz#77da0366ff8afbe733596361d2df9a60fc9c9bd3"
|
||||
integrity sha512-bdNz1L4ekHiJul6SHtZWs1ujEKERJnHs4HxN7rjTyyVOFf3HaJ6sLqe6aPG62XTzAB/63pKRh5jTSWL0D7bsvw==
|
||||
dependencies:
|
||||
arg "^4.1.0"
|
||||
diff "^4.0.1"
|
||||
make-error "^1.1.1"
|
||||
source-map-support "^0.5.17"
|
||||
yn "3.1.1"
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
|
||||
|
|
@ -528,6 +675,11 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
|||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
|
||||
|
||||
typescript@^3.7.5:
|
||||
version "3.9.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.3.tgz#d3ac8883a97c26139e42df5e93eeece33d610b8a"
|
||||
integrity sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==
|
||||
|
||||
uri-js@^4.2.2:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
|
||||
|
|
@ -578,3 +730,8 @@ yauzl@^2.10.0:
|
|||
dependencies:
|
||||
buffer-crc32 "~0.2.3"
|
||||
fd-slicer "~1.1.0"
|
||||
|
||||
yn@3.1.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
|
||||
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
<Reference Include="Microsoft.AspNetCore.Mvc" />
|
||||
<Reference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" />
|
||||
<Reference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" />
|
||||
<Reference Include="Microsoft.AspNetCore.Testing" />
|
||||
<Reference Include="Microsoft.Extensions.Hosting" />
|
||||
<Reference Include="Microsoft.Extensions.Logging.Testing" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,626 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.E2ETesting;
|
||||
using Microsoft.AspNetCore.Internal;
|
||||
using Microsoft.AspNetCore.Testing;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Support.Extensions;
|
||||
using Templates.Test.Helpers;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace Templates.Test
|
||||
{
|
||||
public class BlazorWasmTemplateTest : BrowserTestBase
|
||||
{
|
||||
public BlazorWasmTemplateTest(ProjectFactoryFixture projectFactory, BrowserFixture browserFixture, ITestOutputHelper output)
|
||||
: base(browserFixture, output)
|
||||
{
|
||||
ProjectFactory = projectFactory;
|
||||
}
|
||||
|
||||
public ProjectFactoryFixture ProjectFactory { get; set; }
|
||||
|
||||
public override Task InitializeAsync()
|
||||
{
|
||||
return InitializeAsync(isolationContext: Guid.NewGuid().ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task BlazorWasmStandaloneTemplate_Works()
|
||||
{
|
||||
var project = await ProjectFactory.GetOrCreateProject("blazorstandalone", Output);
|
||||
project.TargetFramework = "netstandard2.1";
|
||||
|
||||
var createResult = await project.RunDotNetNewAsync("blazorwasm");
|
||||
Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", project, createResult));
|
||||
|
||||
var publishResult = await project.RunDotNetPublishAsync();
|
||||
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", project, publishResult));
|
||||
|
||||
// The service worker assets manifest isn't generated for non-PWA projects
|
||||
var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
|
||||
Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js");
|
||||
|
||||
var buildResult = await project.RunDotNetBuildAsync();
|
||||
Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", project, buildResult));
|
||||
|
||||
await BuildAndRunTest(project.ProjectName, project);
|
||||
|
||||
if (BrowserFixture.IsHostAutomationSupported())
|
||||
{
|
||||
var (serveProcess, listeningUri) = RunPublishedStandaloneBlazorProject(project);
|
||||
using (serveProcess)
|
||||
{
|
||||
Output.WriteLine($"Opening browser at {listeningUri}...");
|
||||
Browser.Navigate().GoToUrl(listeningUri);
|
||||
TestBasicNavigation(project.ProjectName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/20172")]
|
||||
public async Task BlazorWasmHostedTemplate_Works()
|
||||
{
|
||||
var project = await ProjectFactory.GetOrCreateProject("blazorhosted", Output);
|
||||
|
||||
var createResult = await project.RunDotNetNewAsync("blazorwasm", args: new[] { "--hosted" });
|
||||
Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", project, createResult));
|
||||
|
||||
var serverProject = GetSubProject(project, "Server", $"{project.ProjectName}.Server");
|
||||
|
||||
var publishResult = await serverProject.RunDotNetPublishAsync();
|
||||
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", serverProject, publishResult));
|
||||
|
||||
var buildResult = await serverProject.RunDotNetBuildAsync();
|
||||
Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", serverProject, buildResult));
|
||||
|
||||
await BuildAndRunTest(project.ProjectName, serverProject);
|
||||
|
||||
using var aspNetProcess = serverProject.StartPublishedProjectAsync();
|
||||
|
||||
Assert.False(
|
||||
aspNetProcess.Process.HasExited,
|
||||
ErrorMessages.GetFailedProcessMessageOrEmpty("Run published project", serverProject, aspNetProcess.Process));
|
||||
|
||||
await aspNetProcess.AssertStatusCode("/", HttpStatusCode.OK, "text/html");
|
||||
await AssertCompressionFormat(aspNetProcess, "br");
|
||||
if (BrowserFixture.IsHostAutomationSupported())
|
||||
{
|
||||
aspNetProcess.VisitInBrowser(Browser);
|
||||
TestBasicNavigation(project.ProjectName);
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task AssertCompressionFormat(AspNetProcess aspNetProcess, string expectedEncoding)
|
||||
{
|
||||
var response = await aspNetProcess.SendRequest(() =>
|
||||
{
|
||||
var request = new HttpRequestMessage(HttpMethod.Get, new Uri(aspNetProcess.ListeningUri, "/_framework/blazor.boot.json"));
|
||||
// These are the same as chrome
|
||||
request.Headers.AcceptEncoding.Clear();
|
||||
request.Headers.AcceptEncoding.Add(StringWithQualityHeaderValue.Parse("gzip"));
|
||||
request.Headers.AcceptEncoding.Add(StringWithQualityHeaderValue.Parse("deflate"));
|
||||
request.Headers.AcceptEncoding.Add(StringWithQualityHeaderValue.Parse("br"));
|
||||
|
||||
return request;
|
||||
});
|
||||
Assert.Equal(expectedEncoding, response.Content.Headers.ContentEncoding.Single());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task BlazorWasmStandalonePwaTemplate_Works()
|
||||
{
|
||||
var project = await ProjectFactory.GetOrCreateProject("blazorstandalonepwa", Output);
|
||||
project.TargetFramework = "netstandard2.1";
|
||||
|
||||
var createResult = await project.RunDotNetNewAsync("blazorwasm", args: new[] { "--pwa" });
|
||||
Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", project, createResult));
|
||||
|
||||
var publishResult = await project.RunDotNetPublishAsync();
|
||||
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", project, publishResult));
|
||||
|
||||
var buildResult = await project.RunDotNetBuildAsync();
|
||||
Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", project, buildResult));
|
||||
|
||||
await BuildAndRunTest(project.ProjectName, project);
|
||||
|
||||
ValidatePublishedServiceWorker(project);
|
||||
|
||||
if (BrowserFixture.IsHostAutomationSupported())
|
||||
{
|
||||
var (serveProcess, listeningUri) = RunPublishedStandaloneBlazorProject(project);
|
||||
using (serveProcess)
|
||||
{
|
||||
Output.WriteLine($"Opening browser at {listeningUri}...");
|
||||
Browser.Navigate().GoToUrl(listeningUri);
|
||||
TestBasicNavigation(project.ProjectName);
|
||||
}
|
||||
|
||||
// The PWA template supports offline use. By now, the browser should have cached everything it needs,
|
||||
// so we can continue working even without the server.
|
||||
ValidateAppWorksOffline(project, listeningUri, skipFetchData: false);
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task BlazorWasmHostedPwaTemplate_Works()
|
||||
{
|
||||
var project = await ProjectFactory.GetOrCreateProject("blazorhostedpwa", Output);
|
||||
|
||||
var createResult = await project.RunDotNetNewAsync("blazorwasm", args: new[] { "--hosted", "--pwa" });
|
||||
Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", project, createResult));
|
||||
|
||||
var serverProject = GetSubProject(project, "Server", $"{project.ProjectName}.Server");
|
||||
|
||||
var publishResult = await serverProject.RunDotNetPublishAsync();
|
||||
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", serverProject, publishResult));
|
||||
|
||||
var buildResult = await serverProject.RunDotNetBuildAsync();
|
||||
Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", serverProject, buildResult));
|
||||
|
||||
await BuildAndRunTest(project.ProjectName, serverProject);
|
||||
|
||||
ValidatePublishedServiceWorker(serverProject);
|
||||
|
||||
string listeningUri = null;
|
||||
if (BrowserFixture.IsHostAutomationSupported())
|
||||
{
|
||||
using (var aspNetProcess = serverProject.StartPublishedProjectAsync())
|
||||
{
|
||||
Assert.False(
|
||||
aspNetProcess.Process.HasExited,
|
||||
ErrorMessages.GetFailedProcessMessageOrEmpty("Run published project", serverProject, aspNetProcess.Process));
|
||||
|
||||
await aspNetProcess.AssertStatusCode("/", HttpStatusCode.OK, "text/html");
|
||||
aspNetProcess.VisitInBrowser(Browser);
|
||||
TestBasicNavigation(project.ProjectName);
|
||||
|
||||
// Note: we don't want to use aspNetProcess.ListeningUri because that isn't necessarily the HTTPS URI
|
||||
var browserUri = new Uri(Browser.Url);
|
||||
listeningUri = $"{browserUri.Scheme}://{browserUri.Authority}";
|
||||
}
|
||||
|
||||
// The PWA template supports offline use. By now, the browser should have cached everything it needs,
|
||||
// so we can continue working even without the server.
|
||||
// Since this is the hosted project, backend APIs won't work offline, so we need to skip "fetchdata"
|
||||
ValidateAppWorksOffline(project, listeningUri, skipFetchData: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidatePublishedServiceWorker(Project project)
|
||||
{
|
||||
var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
|
||||
|
||||
// When publishing the PWA template, we generate an assets manifest
|
||||
// and move service-worker.published.js to overwrite service-worker.js
|
||||
Assert.False(File.Exists(Path.Combine(publishDir, "service-worker.published.js")), "service-worker.published.js should not be published");
|
||||
Assert.True(File.Exists(Path.Combine(publishDir, "service-worker.js")), "service-worker.js should be published");
|
||||
Assert.True(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "service-worker-assets.js should be published");
|
||||
|
||||
// We automatically append the SWAM version as a comment in the published service worker file
|
||||
var serviceWorkerAssetsManifestContents = ReadFile(publishDir, "service-worker-assets.js");
|
||||
var serviceWorkerContents = ReadFile(publishDir, "service-worker.js");
|
||||
|
||||
// Parse the "version": "..." value from the SWAM, and check it's in the service worker
|
||||
var serviceWorkerAssetsManifestVersionMatch = new Regex(@"^\s*\""version\"":\s*(\""[^\""]+\"")", RegexOptions.Multiline)
|
||||
.Match(serviceWorkerAssetsManifestContents);
|
||||
Assert.True(serviceWorkerAssetsManifestVersionMatch.Success);
|
||||
var serviceWorkerAssetsManifestVersionJson = serviceWorkerAssetsManifestVersionMatch.Groups[1].Captures[0].Value;
|
||||
var serviceWorkerAssetsManifestVersion = JsonSerializer.Deserialize<string>(serviceWorkerAssetsManifestVersionJson);
|
||||
Assert.True(serviceWorkerContents.Contains($"/* Manifest version: {serviceWorkerAssetsManifestVersion} */", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
private void ValidateAppWorksOffline(Project project, string listeningUri, bool skipFetchData)
|
||||
{
|
||||
Browser.Navigate().GoToUrl("about:blank"); // Be sure we're really reloading
|
||||
Output.WriteLine($"Opening browser without corresponding server at {listeningUri}...");
|
||||
Browser.Navigate().GoToUrl(listeningUri);
|
||||
TestBasicNavigation(project.ProjectName, skipFetchData: skipFetchData);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(true)]
|
||||
[InlineData(false)]
|
||||
public async Task BlazorWasmHostedTemplate_IndividualAuth_Works(bool useLocalDb)
|
||||
{
|
||||
var project = await ProjectFactory.GetOrCreateProject("blazorhostedindividual" + (useLocalDb ? "uld" : ""), Output);
|
||||
|
||||
var createResult = await project.RunDotNetNewAsync("blazorwasm", args: new[] { "--hosted", "-au", "Individual", useLocalDb ? "-uld" : "" });
|
||||
Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", project, createResult));
|
||||
|
||||
var serverProject = GetSubProject(project, "Server", $"{project.ProjectName}.Server");
|
||||
|
||||
var serverProjectFileContents = ReadFile(serverProject.TemplateOutputDir, $"{serverProject.ProjectName}.csproj");
|
||||
if (!useLocalDb)
|
||||
{
|
||||
Assert.Contains(".db", serverProjectFileContents);
|
||||
}
|
||||
|
||||
var appSettings = ReadFile(serverProject.TemplateOutputDir, "appSettings.json");
|
||||
var element = JsonSerializer.Deserialize<JsonElement>(appSettings);
|
||||
var clientsProperty = element.GetProperty("IdentityServer").EnumerateObject().Single().Value.EnumerateObject().Single();
|
||||
var replacedSection = element.GetRawText().Replace(clientsProperty.Name, serverProject.ProjectName.Replace(".Server", ".Client"));
|
||||
var appSettingsPath = Path.Combine(serverProject.TemplateOutputDir, "appSettings.json");
|
||||
File.WriteAllText(appSettingsPath, replacedSection);
|
||||
|
||||
var publishResult = await serverProject.RunDotNetPublishAsync();
|
||||
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", serverProject, publishResult));
|
||||
|
||||
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
|
||||
// The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
|
||||
// later, while the opposite is not true.
|
||||
|
||||
var buildResult = await serverProject.RunDotNetBuildAsync();
|
||||
Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", serverProject, buildResult));
|
||||
|
||||
var migrationsResult = await serverProject.RunDotNetEfCreateMigrationAsync("blazorwasm");
|
||||
Assert.True(0 == migrationsResult.ExitCode, ErrorMessages.GetFailedProcessMessage("run EF migrations", serverProject, migrationsResult));
|
||||
serverProject.AssertEmptyMigration("blazorwasm");
|
||||
|
||||
if (useLocalDb)
|
||||
{
|
||||
var dbUpdateResult = await serverProject.RunDotNetEfUpdateDatabaseAsync();
|
||||
Assert.True(0 == dbUpdateResult.ExitCode, ErrorMessages.GetFailedProcessMessage("update database", serverProject, dbUpdateResult));
|
||||
}
|
||||
|
||||
await BuildAndRunTest(project.ProjectName, serverProject, usesAuth: true);
|
||||
|
||||
UpdatePublishedSettings(serverProject);
|
||||
|
||||
if (BrowserFixture.IsHostAutomationSupported())
|
||||
{
|
||||
using var aspNetProcess = serverProject.StartPublishedProjectAsync();
|
||||
|
||||
Assert.False(
|
||||
aspNetProcess.Process.HasExited,
|
||||
ErrorMessages.GetFailedProcessMessageOrEmpty("Run published project", serverProject, aspNetProcess.Process));
|
||||
|
||||
await aspNetProcess.AssertStatusCode("/", HttpStatusCode.OK, "text/html");
|
||||
|
||||
aspNetProcess.VisitInBrowser(Browser);
|
||||
TestBasicNavigation(project.ProjectName, usesAuth: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task BlazorWasmStandaloneTemplate_IndividualAuth_Works()
|
||||
{
|
||||
var project = await ProjectFactory.GetOrCreateProject("blazorstandaloneindividual", Output);
|
||||
project.TargetFramework = "netstandard2.1";
|
||||
|
||||
var createResult = await project.RunDotNetNewAsync("blazorwasm", args: new[] {
|
||||
"-au",
|
||||
"Individual",
|
||||
"--authority",
|
||||
"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration",
|
||||
"--client-id",
|
||||
"sample-client-id"
|
||||
});
|
||||
|
||||
Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", project, createResult));
|
||||
|
||||
var publishResult = await project.RunDotNetPublishAsync();
|
||||
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", project, publishResult));
|
||||
|
||||
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
|
||||
// The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
|
||||
// later, while the opposite is not true.
|
||||
|
||||
var buildResult = await project.RunDotNetBuildAsync();
|
||||
Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", project, buildResult));
|
||||
|
||||
// We don't want to test the auth flow as we don't have the required settings to talk to a third-party IdP
|
||||
// but we want to make sure that we are able to run the app without errors.
|
||||
// That will at least test that we are able to initialize and retrieve the configuration from the IdP
|
||||
// for that, we use the common microsoft tenant.
|
||||
await BuildAndRunTest(project.ProjectName, project, usesAuth: false);
|
||||
|
||||
if (BrowserFixture.IsHostAutomationSupported())
|
||||
{
|
||||
var (serveProcess, listeningUri) = RunPublishedStandaloneBlazorProject(project);
|
||||
using (serveProcess)
|
||||
{
|
||||
Output.WriteLine($"Opening browser at {listeningUri}...");
|
||||
Browser.Navigate().GoToUrl(listeningUri);
|
||||
TestBasicNavigation(project.ProjectName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
|
||||
public static TheoryData<TemplateInstance> TemplateData => new TheoryData<TemplateInstance>
|
||||
{
|
||||
new TemplateInstance(
|
||||
"blazorwasmhostedaadb2c", "-ho",
|
||||
"-au", "IndividualB2C",
|
||||
"--aad-b2c-instance", "example.b2clogin.com",
|
||||
"-ssp", "b2c_1_siupin",
|
||||
"--client-id", "clientId",
|
||||
"--domain", "my-domain",
|
||||
"--default-scope", "full",
|
||||
"--app-id-uri", "ApiUri",
|
||||
"--api-client-id", "1234123413241324"),
|
||||
new TemplateInstance(
|
||||
"blazorwasmhostedaad", "-ho",
|
||||
"-au", "SingleOrg",
|
||||
"--domain", "my-domain",
|
||||
"--tenant-id", "tenantId",
|
||||
"--client-id", "clientId",
|
||||
"--default-scope", "full",
|
||||
"--app-id-uri", "ApiUri",
|
||||
"--api-client-id", "1234123413241324"),
|
||||
new TemplateInstance(
|
||||
"blazorwasmstandaloneaadb2c",
|
||||
"-au", "IndividualB2C",
|
||||
"--aad-b2c-instance", "example.b2clogin.com",
|
||||
"-ssp", "b2c_1_siupin",
|
||||
"--client-id", "clientId",
|
||||
"--domain", "my-domain"),
|
||||
new TemplateInstance(
|
||||
"blazorwasmstandaloneaad",
|
||||
"-au", "SingleOrg",
|
||||
"--domain", "my-domain",
|
||||
"--tenant-id", "tenantId",
|
||||
"--client-id", "clientId"),
|
||||
};
|
||||
|
||||
public class TemplateInstance
|
||||
{
|
||||
public TemplateInstance(string name, params string[] arguments)
|
||||
{
|
||||
Name = name;
|
||||
Arguments = arguments;
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
public string[] Arguments { get; }
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(TemplateData))]
|
||||
public async Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_Works(TemplateInstance instance)
|
||||
{
|
||||
var project = await ProjectFactory.GetOrCreateProject(instance.Name, Output);
|
||||
project.TargetFramework = "netstandard2.1";
|
||||
|
||||
var createResult = await project.RunDotNetNewAsync("blazorwasm", args: instance.Arguments);
|
||||
|
||||
Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", project, createResult));
|
||||
|
||||
var publishResult = await project.RunDotNetPublishAsync();
|
||||
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", project, publishResult));
|
||||
|
||||
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
|
||||
// The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
|
||||
// later, while the opposite is not true.
|
||||
|
||||
var buildResult = await project.RunDotNetBuildAsync();
|
||||
Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", project, buildResult));
|
||||
}
|
||||
|
||||
protected async Task BuildAndRunTest(string appName, Project project, bool usesAuth = false)
|
||||
{
|
||||
using var aspNetProcess = project.StartBuiltProjectAsync();
|
||||
|
||||
Assert.False(
|
||||
aspNetProcess.Process.HasExited,
|
||||
ErrorMessages.GetFailedProcessMessageOrEmpty("Run built project", project, aspNetProcess.Process));
|
||||
|
||||
await aspNetProcess.AssertStatusCode("/", HttpStatusCode.OK, "text/html");
|
||||
// We only do brotli precompression for published apps
|
||||
await AssertCompressionFormat(aspNetProcess, "gzip");
|
||||
if (BrowserFixture.IsHostAutomationSupported())
|
||||
{
|
||||
aspNetProcess.VisitInBrowser(Browser);
|
||||
TestBasicNavigation(appName, usesAuth);
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
|
||||
private void TestBasicNavigation(string appName, bool usesAuth = false, bool skipFetchData = false)
|
||||
{
|
||||
// Start fresh always
|
||||
if (usesAuth)
|
||||
{
|
||||
Browser.ExecuteJavaScript("sessionStorage.clear()");
|
||||
Browser.ExecuteJavaScript("localStorage.clear()");
|
||||
Browser.Manage().Cookies.DeleteAllCookies();
|
||||
Browser.Navigate().Refresh();
|
||||
}
|
||||
|
||||
// Give components.server enough time to load so that it can replace
|
||||
// the prerendered content before we start making assertions.
|
||||
Thread.Sleep(5000);
|
||||
Browser.Exists(By.TagName("ul"));
|
||||
|
||||
// <title> element gets project ID injected into it during template execution
|
||||
Browser.Equal(appName.Trim(), () => Browser.Title.Trim());
|
||||
|
||||
// Initially displays the home page
|
||||
Browser.Equal("Hello, world!", () => Browser.FindElement(By.TagName("h1")).Text);
|
||||
|
||||
// Can navigate to the counter page
|
||||
Browser.FindElement(By.PartialLinkText("Counter")).Click();
|
||||
Browser.Contains("counter", () => Browser.Url);
|
||||
Browser.Equal("Counter", () => Browser.FindElement(By.TagName("h1")).Text);
|
||||
|
||||
// Clicking the counter button works
|
||||
Browser.Equal("Current count: 0", () => Browser.FindElement(By.CssSelector("h1 + p")).Text);
|
||||
Browser.FindElement(By.CssSelector("p+button")).Click();
|
||||
Browser.Equal("Current count: 1", () => Browser.FindElement(By.CssSelector("h1 + p")).Text);
|
||||
|
||||
if (usesAuth)
|
||||
{
|
||||
Browser.FindElement(By.PartialLinkText("Log in")).Click();
|
||||
Browser.Contains("/Identity/Account/Login", () => Browser.Url);
|
||||
|
||||
Browser.FindElement(By.PartialLinkText("Register as a new user")).Click();
|
||||
|
||||
var userName = $"{Guid.NewGuid()}@example.com";
|
||||
var password = $"!Test.Password1$";
|
||||
Browser.Exists(By.Name("Input.Email"));
|
||||
Browser.FindElement(By.Name("Input.Email")).SendKeys(userName);
|
||||
Browser.FindElement(By.Name("Input.Password")).SendKeys(password);
|
||||
Browser.FindElement(By.Name("Input.ConfirmPassword")).SendKeys(password);
|
||||
Browser.FindElement(By.Id("registerSubmit")).Click();
|
||||
|
||||
// We will be redirected to the RegisterConfirmation
|
||||
Browser.Contains("/Identity/Account/RegisterConfirmation", () => Browser.Url);
|
||||
Browser.FindElement(By.PartialLinkText("Click here to confirm your account")).Click();
|
||||
|
||||
// We will be redirected to the ConfirmEmail
|
||||
Browser.Contains("/Identity/Account/ConfirmEmail", () => Browser.Url);
|
||||
|
||||
// Now we can login
|
||||
Browser.FindElement(By.PartialLinkText("Login")).Click();
|
||||
Browser.Exists(By.Name("Input.Email"));
|
||||
Browser.FindElement(By.Name("Input.Email")).SendKeys(userName);
|
||||
Browser.FindElement(By.Name("Input.Password")).SendKeys(password);
|
||||
Browser.FindElement(By.Id("login-submit")).Click();
|
||||
|
||||
// Need to navigate to fetch page
|
||||
Browser.Navigate().GoToUrl(new Uri(Browser.Url).GetLeftPart(UriPartial.Authority));
|
||||
Browser.Equal(appName.Trim(), () => Browser.Title.Trim());
|
||||
}
|
||||
|
||||
if (!skipFetchData)
|
||||
{
|
||||
// Can navigate to the 'fetch data' page
|
||||
Browser.FindElement(By.PartialLinkText("Fetch data")).Click();
|
||||
Browser.Contains("fetchdata", () => Browser.Url);
|
||||
Browser.Equal("Weather forecast", () => Browser.FindElement(By.TagName("h1")).Text);
|
||||
|
||||
// Asynchronously loads and displays the table of weather forecasts
|
||||
Browser.Exists(By.CssSelector("table>tbody>tr"));
|
||||
Browser.Equal(5, () => Browser.FindElements(By.CssSelector("p+table>tbody>tr")).Count);
|
||||
}
|
||||
}
|
||||
|
||||
private string ReadFile(string basePath, string path)
|
||||
{
|
||||
var fullPath = Path.Combine(basePath, path);
|
||||
var doesExist = File.Exists(fullPath);
|
||||
|
||||
Assert.True(doesExist, $"Expected file to exist, but it doesn't: {path}");
|
||||
return File.ReadAllText(Path.Combine(basePath, path));
|
||||
}
|
||||
|
||||
private Project GetSubProject(Project project, string projectDirectory, string projectName)
|
||||
{
|
||||
var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory);
|
||||
if (!Directory.Exists(subProjectDirectory))
|
||||
{
|
||||
throw new DirectoryNotFoundException($"Directory {subProjectDirectory} was not found.");
|
||||
}
|
||||
|
||||
var subProject = new Project
|
||||
{
|
||||
Output = project.Output,
|
||||
DiagnosticsMessageSink = project.DiagnosticsMessageSink,
|
||||
ProjectName = projectName,
|
||||
TemplateOutputDir = subProjectDirectory,
|
||||
};
|
||||
|
||||
return subProject;
|
||||
}
|
||||
|
||||
private void UpdatePublishedSettings(Project serverProject)
|
||||
{
|
||||
// Hijack here the config file to use the development key during publish.
|
||||
var appSettings = JObject.Parse(File.ReadAllText(Path.Combine(serverProject.TemplateOutputDir, "appsettings.json")));
|
||||
var appSettingsDevelopment = JObject.Parse(File.ReadAllText(Path.Combine(serverProject.TemplateOutputDir, "appsettings.Development.json")));
|
||||
((JObject)appSettings["IdentityServer"]).Merge(appSettingsDevelopment["IdentityServer"]);
|
||||
((JObject)appSettings["IdentityServer"]).Merge(new
|
||||
{
|
||||
IdentityServer = new
|
||||
{
|
||||
Key = new
|
||||
{
|
||||
FilePath = "./tempkey.json"
|
||||
}
|
||||
}
|
||||
});
|
||||
var testAppSettings = appSettings.ToString();
|
||||
File.WriteAllText(Path.Combine(serverProject.TemplatePublishDir, "appsettings.json"), testAppSettings);
|
||||
}
|
||||
|
||||
|
||||
private (ProcessEx, string url) RunPublishedStandaloneBlazorProject(Project project)
|
||||
{
|
||||
var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
|
||||
|
||||
Output.WriteLine("Running dotnet serve on published output...");
|
||||
var developmentCertificate = DevelopmentCertificate.Create(project.TemplateOutputDir);
|
||||
var serveProcess = ProcessEx.Run(Output, publishDir, DotNetMuxer.MuxerPathOrDefault(), $"serve -S --pfx \"{developmentCertificate.CertificatePath}\" --pfx-pwd \"{developmentCertificate.CertificatePassword}\" --port 0");
|
||||
var listeningUri = ResolveListeningUrl(serveProcess);
|
||||
return (serveProcess, listeningUri);
|
||||
}
|
||||
|
||||
private static string ResolveListeningUrl(ProcessEx process)
|
||||
{
|
||||
var buffer = new List<string>();
|
||||
try
|
||||
{
|
||||
foreach (var line in process.OutputLinesAsEnumerable)
|
||||
{
|
||||
if (line != null)
|
||||
{
|
||||
buffer.Add(line);
|
||||
if (line.Trim().Contains("https://", StringComparison.Ordinal) || line.Trim().Contains("http://", StringComparison.Ordinal))
|
||||
{
|
||||
return line.Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
}
|
||||
|
||||
throw new InvalidOperationException(@$"Couldn't find listening url:
|
||||
{string.Join(Environment.NewLine, buffer.Append(process.Error))}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# This file is generated by the build
|
||||
content/*/*.*proj
|
||||
content/*/*/*.*proj
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ComponentsWebAssemblyProjectsRoot>$(RepoRoot)src\Components\WebAssembly\</ComponentsWebAssemblyProjectsRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
<IsShippingPackage>true</IsShippingPackage>
|
||||
<Description>Templates for ASP.NET Core Blazor WebAssembly projects.</Description>
|
||||
<PackageTags>$(PackageTags);blazor;spa</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Lists the versions of dependencies not built in this repo. Packages produced from this repo should be listed as a PackageVersionVariableReference. -->
|
||||
<GeneratedContentProperties>
|
||||
DefaultNetCoreTargetFramework=$(DefaultNetCoreTargetFramework);
|
||||
MicrosoftEntityFrameworkCoreSqlServerPackageVersion=$(MicrosoftEntityFrameworkCoreSqlServerPackageVersion);
|
||||
MicrosoftEntityFrameworkCoreSqlitePackageVersion=$(MicrosoftEntityFrameworkCoreSqlitePackageVersion);
|
||||
MicrosoftEntityFrameworkCoreToolsPackageVersion=$(MicrosoftEntityFrameworkCoreToolsPackageVersion);
|
||||
MicrosoftExtensionsHttpPackageVersion=$(MicrosoftExtensionsHttpPackageVersion);
|
||||
SystemNetHttpJsonPackageVersion=$(SystemNetHttpJsonPackageVersion)
|
||||
</GeneratedContentProperties>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- These projects product packages that the templates depend on. See GenerateContent.targets -->
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Azure\AzureAD\Authentication.AzureAD.UI\src\Microsoft.AspNetCore.Authentication.AzureAD.UI.csproj" />
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Azure\AzureAD\Authentication.AzureADB2C.UI\src\Microsoft.AspNetCore.Authentication.AzureADB2C.UI.csproj" />
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Identity\EntityFrameworkCore\src\Microsoft.AspNetCore.Identity.EntityFrameworkCore.csproj" />
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Identity\ApiAuthorization.IdentityServer\src\Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj" />
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Identity\UI\src\Microsoft.AspNetCore.Identity.UI.csproj" />
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Middleware\Diagnostics.EntityFrameworkCore\src\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)WebAssembly\src\Microsoft.AspNetCore.Components.WebAssembly.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)Build\src\Microsoft.AspNetCore.Components.WebAssembly.Build.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)DevServer\src\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)Server\src\Microsoft.AspNetCore.Components.WebAssembly.Server.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)WebAssembly.Authentication\src\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)Authentication.Msal\src\Microsoft.Authentication.WebAssembly.Msal.csproj" />
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Client.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Client/ComponentsWebAssembly-CSharp.Client.csproj" />
|
||||
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Shared.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Shared/ComponentsWebAssembly-CSharp.Shared.csproj" />
|
||||
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Server.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Server/ComponentsWebAssembly-CSharp.Server.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<!-- Intentionally does not import parent Directory.Build.props file to isolate templates projects from the rest of the repo -->
|
||||
<Project>
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\..\..\build\dependencies.props" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\..\..\build\sources.props" />
|
||||
</Project>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!-- Intentionally empty to isolate templates projects from the rest of the repo -->
|
||||
<Project />
|
||||
|
|
@ -177,8 +177,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.ApiAut
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices.Extensions", "..\Middleware\SpaServices.Extensions\src\Microsoft.AspNetCore.SpaServices.Extensions.csproj", "{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebAssembly.Templates", "ComponentsWebAssembly.ProjectTemplates\Microsoft.AspNetCore.Components.WebAssembly.Templates.csproj", "{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorTemplates.Tests", "BlazorTemplates.Tests\BlazorTemplates.Tests.csproj", "{5526E9AA-F147-43F6-8FA3-21A93D2A813E}"
|
||||
EndProject
|
||||
Global
|
||||
|
|
@ -1223,18 +1221,6 @@ Global
|
|||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|x64.Build.0 = Release|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|x86.Build.0 = Release|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Release|x64.Build.0 = Release|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{5AE7B4C4-790D-4809-A5FE-D7303DFBC11B}.Release|x86.Build.0 = Release|Any CPU
|
||||
{5526E9AA-F147-43F6-8FA3-21A93D2A813E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5526E9AA-F147-43F6-8FA3-21A93D2A813E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5526E9AA-F147-43F6-8FA3-21A93D2A813E}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
|
|
@ -12,7 +11,6 @@ using System.Net.Security;
|
|||
using System.Threading.Tasks;
|
||||
using AngleSharp.Dom.Html;
|
||||
using AngleSharp.Parser.Html;
|
||||
using Microsoft.AspNetCore.Certificates.Generation;
|
||||
using Microsoft.AspNetCore.Internal;
|
||||
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
|
|
@ -31,10 +29,7 @@ namespace Templates.Test.Helpers
|
|||
private const string ListeningMessagePrefix = "Now listening on: ";
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly ITestOutputHelper _output;
|
||||
|
||||
private string _certificatePath;
|
||||
private string _certificatePassword = Guid.NewGuid().ToString();
|
||||
private string _certificateThumbprint;
|
||||
private readonly DevelopmentCertificate _developmentCertificate;
|
||||
|
||||
internal readonly Uri ListeningUri;
|
||||
internal ProcessEx Process { get; }
|
||||
|
|
@ -48,8 +43,7 @@ namespace Templates.Test.Helpers
|
|||
bool hasListeningUri = true,
|
||||
ILogger logger = null)
|
||||
{
|
||||
_certificatePath = Path.Combine(workingDirectory, $"{Guid.NewGuid()}.pfx");
|
||||
EnsureDevelopmentCertificates();
|
||||
_developmentCertificate = DevelopmentCertificate.Create(workingDirectory);
|
||||
|
||||
_output = output;
|
||||
_httpClient = new HttpClient(new HttpClientHandler()
|
||||
|
|
@ -57,7 +51,7 @@ namespace Templates.Test.Helpers
|
|||
AllowAutoRedirect = true,
|
||||
UseCookies = true,
|
||||
CookieContainer = new CookieContainer(),
|
||||
ServerCertificateCustomValidationCallback = (request, certificate, chain, errors) => (certificate.Subject != "CN=localhost" && errors == SslPolicyErrors.None) || certificate?.Thumbprint == _certificateThumbprint,
|
||||
ServerCertificateCustomValidationCallback = (request, certificate, chain, errors) => (certificate.Subject != "CN=localhost" && errors == SslPolicyErrors.None) || certificate?.Thumbprint == _developmentCertificate.CertificateThumbprint,
|
||||
})
|
||||
{
|
||||
Timeout = TimeSpan.FromMinutes(2)
|
||||
|
|
@ -71,8 +65,8 @@ namespace Templates.Test.Helpers
|
|||
|
||||
var finalEnvironmentVariables = new Dictionary<string, string>(environmentVariables)
|
||||
{
|
||||
["ASPNETCORE_Kestrel__Certificates__Default__Path"] = _certificatePath,
|
||||
["ASPNETCORE_Kestrel__Certificates__Default__Password"] = _certificatePassword
|
||||
["ASPNETCORE_Kestrel__Certificates__Default__Path"] = _developmentCertificate.CertificatePath,
|
||||
["ASPNETCORE_Kestrel__Certificates__Default__Password"] = _developmentCertificate.CertificatePassword,
|
||||
};
|
||||
|
||||
Process = ProcessEx.Run(output, workingDirectory, DotNetMuxer.MuxerPathOrDefault(), arguments, envVars: finalEnvironmentVariables);
|
||||
|
|
@ -87,15 +81,6 @@ namespace Templates.Test.Helpers
|
|||
}
|
||||
}
|
||||
|
||||
internal void EnsureDevelopmentCertificates()
|
||||
{
|
||||
var now = DateTimeOffset.Now;
|
||||
var manager = CertificateManager.Instance;
|
||||
var certificate = manager.CreateAspNetCoreHttpsDevelopmentCertificate(now, now.AddYears(1));
|
||||
_certificateThumbprint = certificate.Thumbprint;
|
||||
manager.ExportCertificate(certificate, path: _certificatePath, includePrivateKey: true, _certificatePassword);
|
||||
}
|
||||
|
||||
public void VisitInBrowser(IWebDriver driver)
|
||||
{
|
||||
_output.WriteLine($"Opening browser at {ListeningUri}...");
|
||||
|
|
@ -249,6 +234,9 @@ namespace Templates.Test.Helpers
|
|||
internal Task<HttpResponseMessage> SendRequest(string path) =>
|
||||
RetryHelper.RetryRequest(() => _httpClient.GetAsync(new Uri(ListeningUri, path)), logger: NullLogger.Instance);
|
||||
|
||||
internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
|
||||
=> RetryHelper.RetryRequest(() => _httpClient.SendAsync(requestFactory()), logger: NullLogger.Instance);
|
||||
|
||||
public async Task AssertStatusCode(string requestUrl, HttpStatusCode statusCode, string acceptContentType = null)
|
||||
{
|
||||
var response = await RetryHelper.RetryRequest(() =>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore.Certificates.Generation;
|
||||
|
||||
namespace Templates.Test.Helpers
|
||||
{
|
||||
public readonly struct DevelopmentCertificate
|
||||
{
|
||||
public DevelopmentCertificate(string certificatePath, string certificatePassword, string certificateThumbprint)
|
||||
{
|
||||
CertificatePath = certificatePath;
|
||||
CertificatePassword = certificatePassword;
|
||||
CertificateThumbprint = certificateThumbprint;
|
||||
}
|
||||
|
||||
public readonly string CertificatePath { get; }
|
||||
public readonly string CertificatePassword { get; }
|
||||
public readonly string CertificateThumbprint { get; }
|
||||
|
||||
public static DevelopmentCertificate Create(string workingDirectory)
|
||||
{
|
||||
var certificatePath = Path.Combine(workingDirectory, $"{Guid.NewGuid()}.pfx");
|
||||
var certificatePassword = Guid.NewGuid().ToString();
|
||||
var certificateThumbprint = EnsureDevelopmentCertificates(certificatePath, certificatePassword);
|
||||
|
||||
return new DevelopmentCertificate(certificatePath, certificatePassword, certificateThumbprint);
|
||||
}
|
||||
|
||||
private static string EnsureDevelopmentCertificates(string certificatePath, string certificatePassword)
|
||||
{
|
||||
var now = DateTimeOffset.Now;
|
||||
var manager = CertificateManager.Instance;
|
||||
var certificate = manager.CreateAspNetCoreHttpsDevelopmentCertificate(now, now.AddYears(1));
|
||||
var certificateThumbprint = certificate.Thumbprint;
|
||||
manager.ExportCertificate(certificate, path: certificatePath, includePrivateKey: true, certificatePassword);
|
||||
|
||||
return certificateThumbprint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -220,6 +220,31 @@ namespace Templates.Test.Helpers
|
|||
}
|
||||
}
|
||||
|
||||
internal async Task<ProcessResult> RunDotNetEfUpdateDatabaseAsync()
|
||||
{
|
||||
var assembly = typeof(ProjectFactoryFixture).Assembly;
|
||||
|
||||
var dotNetEfFullPath = assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
|
||||
.First(attribute => attribute.Key == "DotNetEfFullPath")
|
||||
.Value;
|
||||
|
||||
var args = $"\"{dotNetEfFullPath}\" --verbose --no-build database update";
|
||||
|
||||
// Only run one instance of 'dotnet new' at once, as a workaround for
|
||||
// https://github.com/aspnet/templating/issues/63
|
||||
await DotNetNewLock.WaitAsync();
|
||||
try
|
||||
{
|
||||
using var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), args);
|
||||
await result.Exited;
|
||||
return new ProcessResult(result);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DotNetNewLock.Release();
|
||||
}
|
||||
}
|
||||
|
||||
// If this fails, you should generate new migrations via migrations/updateMigrations.cmd
|
||||
public void AssertEmptyMigration(string migration)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
<PackageId>Microsoft.DotNet.Web.ProjectTemplates.$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)</PackageId>
|
||||
<Description>ASP.NET Core Web Template Pack for Microsoft Template Engine</Description>
|
||||
<IsPackable>true</IsPackable>
|
||||
<ComponentsWebAssemblyProjectsRoot>$(RepoRoot)src\Components\WebAssembly\</ComponentsWebAssemblyProjectsRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
@ -17,8 +18,9 @@
|
|||
MicrosoftEntityFrameworkCoreSqlServerPackageVersion=$(MicrosoftEntityFrameworkCoreSqlServerPackageVersion);
|
||||
MicrosoftEntityFrameworkCoreToolsPackageVersion=$(MicrosoftEntityFrameworkCoreToolsPackageVersion);
|
||||
MicrosoftExtensionsHostingPackageVersion=$(MicrosoftExtensionsHostingPackageVersion);
|
||||
MicrosoftExtensionsHttpPackageVersion=$(MicrosoftExtensionsHttpPackageVersion);
|
||||
MicrosoftNETCoreAppRuntimeVersion=$(MicrosoftNETCoreAppRuntimeVersion);
|
||||
TemplateComponentsPackageVersion=$(TemplateComponentsPackageVersion);
|
||||
SystemNetHttpJsonPackageVersion=$(SystemNetHttpJsonPackageVersion);
|
||||
</GeneratedContentProperties>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
@ -30,8 +32,15 @@
|
|||
<PackageVersionVariableReference Include="$(RepoRoot)src\Components\Web\src\Microsoft.AspNetCore.Components.Web.csproj" />
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Identity\EntityFrameworkCore\src\Microsoft.AspNetCore.Identity.EntityFrameworkCore.csproj" />
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Identity\UI\src\Microsoft.AspNetCore.Identity.UI.csproj" />
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Identity\ApiAuthorization.IdentityServer\src\Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj" />
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Middleware\Diagnostics.EntityFrameworkCore\src\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj" />
|
||||
<PackageVersionVariableReference Include="$(RepoRoot)src\Mvc\Mvc.Razor.RuntimeCompilation\src\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)WebAssembly\src\Microsoft.AspNetCore.Components.WebAssembly.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)Build\src\Microsoft.AspNetCore.Components.WebAssembly.Build.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)DevServer\src\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)Server\src\Microsoft.AspNetCore.Components.WebAssembly.Server.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)WebAssembly.Authentication\src\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj" />
|
||||
<PackageVersionVariableReference Include="$(ComponentsWebAssemblyProjectsRoot)Authentication.Msal\src\Microsoft.Authentication.WebAssembly.Msal.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -46,6 +55,9 @@
|
|||
<GeneratedContent Include="WebApi-CSharp.csproj.in" OutputPath="content/WebApi-CSharp/Company.WebApplication1.csproj" />
|
||||
<GeneratedContent Include="WebApi-FSharp.fsproj.in" OutputPath="content/WebApi-FSharp/Company.WebApplication1.fsproj" />
|
||||
<GeneratedContent Include="Worker-CSharp.csproj.in" OutputPath="content/Worker-CSharp/Company.Application1.csproj" />
|
||||
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Client.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Client/ComponentsWebAssembly-CSharp.Client.csproj" />
|
||||
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Shared.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Shared/ComponentsWebAssembly-CSharp.Shared.csproj" />
|
||||
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Server.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Server/ComponentsWebAssembly-CSharp.Server.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
|
@ -19,7 +19,7 @@
|
|||
"09732173-2cef-46b7-83db-1334bcb079d3", // Tenant ID
|
||||
"53bc9b9d-9d6a-45d4-8429-2a2761773502" // Client ID
|
||||
],
|
||||
"identity": "Microsoft.Web.Blazor.Wasm.CSharp",
|
||||
"identity": "Microsoft.Web.Blazor.Wasm.CSharp.5.0",
|
||||
"preferNameDirectory": true,
|
||||
"primaryOutputs": [
|
||||
{
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
@page "/authentication/{action}"
|
||||
@page "/authentication/{action}"
|
||||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
|
||||
<RemoteAuthenticatorView Action="@Action" />
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
@page "/fetchdata"
|
||||
@page "/fetchdata"
|
||||
@*#if (!NoAuth && Hosted)
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
@inject NavigationManager Navigation
|
||||
@inject NavigationManager Navigation
|
||||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
|
||||
@code {
|
||||
protected override void OnInitialized()
|
||||
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |