Merge branch 'master' into merge/release/3.1-to-master\n\nCommit migrated from c01b984fe9
This commit is contained in:
commit
9cf7425328
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Extensions
|
|||
";
|
||||
|
||||
var output = context.CodeWriter.GenerateCode();
|
||||
Assert.Equal(expected, output);
|
||||
Assert.Equal(expected, output, ignoreLineEndingDifferences: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X
|
|||
// Arrange
|
||||
var content = @"
|
||||
@* some comment *@
|
||||
|
||||
|
||||
@page
|
||||
";
|
||||
var codeDocument = RazorCodeDocument.Create(RazorSourceDocument.Create(content, "Test.cshtml"));
|
||||
|
|
@ -363,7 +363,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X
|
|||
{
|
||||
PageDirective.Register(builder);
|
||||
}
|
||||
|
||||
|
||||
private static DocumentIntermediateNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument)
|
||||
{
|
||||
for (var i = 0; i < engine.Phases.Count; i++)
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
// Arrange
|
||||
var content = @"
|
||||
@* some comment *@
|
||||
|
||||
|
||||
@page
|
||||
";
|
||||
var codeDocument = RazorCodeDocument.Create(RazorSourceDocument.Create(content, "Test.cshtml"));
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
|
|||
|
||||
Pass.Engine = Engine;
|
||||
}
|
||||
|
||||
|
||||
private DefaultRazorProjectEngine ProjectEngine { get; }
|
||||
|
||||
private RazorEngine Engine { get; }
|
||||
|
|
@ -81,7 +81,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
|
|||
Assert.Equal(expected, block.Content, ignoreLineEndingDifferences: true);
|
||||
}
|
||||
|
||||
// See: https://github.com/aspnet/AspNetCore/issues/6480
|
||||
// See: https://github.com/dotnet/aspnetcore/issues/6480
|
||||
[Fact]
|
||||
public void Execute_RewritesHtml_HtmlAttributePrefix()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5120,7 +5120,7 @@ namespace Test
|
|||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact] // https://github.com/aspnet/Blazor/issues/597
|
||||
[Fact] // https://github.com/dotnet/blazor/issues/597
|
||||
public void Regression_597()
|
||||
{
|
||||
// Arrange
|
||||
|
|
@ -5186,7 +5186,7 @@ namespace Test
|
|||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact] // https://github.com/aspnet/Blazor/issues/772
|
||||
[Fact] // https://github.com/dotnet/blazor/issues/772
|
||||
public void Regression_772()
|
||||
{
|
||||
// Arrange
|
||||
|
|
@ -5224,7 +5224,7 @@ Welcome to your new app.
|
|||
d => Assert.Equal("RZ1035", d.Id));
|
||||
}
|
||||
|
||||
[Fact] // https://github.com/aspnet/Blazor/issues/773
|
||||
[Fact] // https://github.com/dotnet/blazor/issues/773
|
||||
public void Regression_773()
|
||||
{
|
||||
// Arrange
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
|
|||
Assert.Contains(typeof(IDoCoolThings), component.GetType().GetInterfaces());
|
||||
}
|
||||
|
||||
[Fact] // Regression test for https://github.com/aspnet/Blazor/issues/453
|
||||
[Fact] // Regression test for https://github.com/dotnet/blazor/issues/453
|
||||
public void DeclarationConfiguration_FunctionsBlockHasLineMappings_MappingsApplyToError()
|
||||
{
|
||||
// Arrange & Act 1
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
|
||||
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="$(TEST_NewtonsoftJsonPackageVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ Delta: Gamma: Beta: Test B
|
|||
|
||||
var actual = builder.ToString();
|
||||
|
||||
Assert.Equal(expected, actual);
|
||||
Assert.Equal(expected, actual, ignoreLineEndingDifferences: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
<!-- Paths to tools, tasks, and extensions are calculated relative to the RazorSdkDirectoryRoot. This can be modified to test a local build. -->
|
||||
<RazorSdkDirectoryRoot Condition="'$(RazorSdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\..\</RazorSdkDirectoryRoot>
|
||||
<RazorSdkBuildTasksDirectoryRoot Condition="'$(RazorSdkBuildTasksDirectoryRoot)'==''">$(RazorSdkDirectoryRoot)tasks\</RazorSdkBuildTasksDirectoryRoot>
|
||||
<_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">netcoreapp3.1</_RazorSdkTasksTFM>
|
||||
<_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">netcoreapp5.0</_RazorSdkTasksTFM>
|
||||
<_RazorSdkTasksTFM Condition=" '$(_RazorSdkTasksTFM)' == ''">net46</_RazorSdkTasksTFM>
|
||||
<RazorSdkBuildTasksAssembly>$(RazorSdkBuildTasksDirectoryRoot)$(_RazorSdkTasksTFM)\Microsoft.NET.Sdk.Razor.Tasks.dll</RazorSdkBuildTasksAssembly>
|
||||
</PropertyGroup>
|
||||
|
|
@ -516,7 +516,7 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
</Target>
|
||||
|
||||
<!--
|
||||
Temporarary workaround for https://github.com/aspnet/AspNetCore/issues/6859. This can be removed after a VS insertion with a newer copy of the DesignTime targets.
|
||||
Temporarary workaround for https://github.com/dotnet/aspnetcore/issues/6859. This can be removed after a VS insertion with a newer copy of the DesignTime targets.
|
||||
-->
|
||||
<ItemGroup>
|
||||
<Content Update="$(_RazorComponentInclude)">
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
internal static partial class BuildVariables
|
||||
{
|
||||
private static string _msBuildPath = string.Empty;
|
||||
private static string _microsoftNETCoreApp31PackageVersion = string.Empty;
|
||||
private static string _MicrosoftNETCoreApp50PackageVersion = string.Empty;
|
||||
private static string _microsoftNetCompilersToolsetPackageVersion = string.Empty;
|
||||
|
||||
static partial void InitializeVariables();
|
||||
|
|
@ -20,12 +20,12 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
}
|
||||
}
|
||||
|
||||
public static string MicrosoftNETCoreApp31PackageVersion
|
||||
public static string MicrosoftNETCoreApp50PackageVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
InitializeVariables();
|
||||
return _microsoftNETCoreApp31PackageVersion;
|
||||
return _MicrosoftNETCoreApp50PackageVersion;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
}
|
||||
}
|
||||
|
||||
// Regression test for https://github.com/aspnet/AspNetCore/issues/11315
|
||||
// Regression test for https://github.com/dotnet/aspnetcore/issues/11315
|
||||
[Fact]
|
||||
[InitializeTestProject("AppWithP2PReference", additionalProjects: "ClassLibrary")]
|
||||
public async Task BuildIncrementalism_CausingRecompilation_WhenApplicationPartAttributeIsGenerated()
|
||||
|
|
@ -123,7 +123,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
Assert.AssemblyHasAttribute(result, Path.Combine(OutputPath, "AppWithP2PReference.dll"), "Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/13303")]
|
||||
[InitializeTestProject("SimpleMvcFSharp", language: "F#", additionalProjects: "ClassLibrary")]
|
||||
public async Task Build_ProjectWithDependencyThatReferencesMvc_AddsAttributeToNonCSharpProjects()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
Assert.FileDoesNotContain(result, razorAssemblyInfo, "Microsoft.AspNetCore.Razor.Hosting.RazorConfigurationNameAttribute");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/13303")]
|
||||
[InitializeTestProject("SimpleMvcFSharp", language: "F#")]
|
||||
public async Task Build_SimpleMvcFSharp_NoopsWithoutFailing()
|
||||
{
|
||||
|
|
@ -639,13 +639,15 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
|
||||
}
|
||||
|
||||
[Fact(Skip = "Default C# version is 7.3 for netcoreapp3.1 and later https://github.com/aspnet/AspNetCore/issues/13930")]
|
||||
[Fact(Skip = "Default C# version is 7.3 for netcoreapp3.1 and later https://github.com/dotnet/aspnetcore/issues/13930")]
|
||||
[InitializeTestProject("SimpleMvc")]
|
||||
public async Task Build_ImplicitCSharp8_NullableEnforcement_WarningsDuringBuild_NoBuildServer()
|
||||
{
|
||||
var result = await DotnetMSBuild(
|
||||
"Build",
|
||||
"/p:Nullable=enable",
|
||||
// Remove /p:LangVersion=Default once we've picked up a compiler that supports .NET 5.0.
|
||||
// Tracked by https://github.com/dotnet/aspnetcore/issues/13304
|
||||
"/p:Nullable=enable /p:LangVersion=Default",
|
||||
suppressBuildServer: true);
|
||||
var indexFilePath = Path.Combine(RazorIntermediateOutputPath, "Views", "Home", "Index.cshtml.g.cs");
|
||||
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
[InitializeTestProject("SimpleMvc")]
|
||||
public async Task IntrospectJsonContentFiles_WithExcludeConfigFilesFromBuildOutputSet()
|
||||
{
|
||||
// Verifies that the fix for https://github.com/aspnet/AspNetCore/issues/14017 works.
|
||||
// Verifies that the fix for https://github.com/dotnet/aspnetcore/issues/14017 works.
|
||||
var result = await DotnetMSBuild("_IntrospectContentItems", "/p:ExcludeConfigFilesFromBuildOutput=true");
|
||||
|
||||
Assert.BuildPassed(result);
|
||||
|
|
@ -235,8 +235,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
.Value;
|
||||
|
||||
var tfm =
|
||||
#if NETCOREAPP3_1
|
||||
"netcoreapp3.1";
|
||||
#if NETCOREAPP5_0
|
||||
"netcoreapp5.0";
|
||||
#else
|
||||
#error Target framework needs to be updated.
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
|
||||
MSBuildIntegrationTestBase.Project = ProjectDirectory.Create(_originalProjectName, _testProjectName, _baseDirectory, _additionalProjects, _language);
|
||||
#if NETCOREAPP
|
||||
MSBuildIntegrationTestBase.TargetFramework = "netcoreapp3.1";
|
||||
MSBuildIntegrationTestBase.TargetFramework = "netcoreapp5.0";
|
||||
#else
|
||||
#error Target frameworks need to be updated
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
// Let the test app know it is running as part of a test.
|
||||
"/p:RunningAsTest=true",
|
||||
|
||||
$"/p:MicrosoftNETCoreApp31PackageVersion={BuildVariables.MicrosoftNETCoreApp31PackageVersion}",
|
||||
$"/p:MicrosoftNETCoreApp50PackageVersion={BuildVariables.MicrosoftNETCoreApp50PackageVersion}",
|
||||
$"/p:MicrosoftNetCompilersToolsetPackageVersion={BuildVariables.MicrosoftNetCompilersToolsetPackageVersion}",
|
||||
|
||||
// Additional restore sources for projects that require built packages
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
{
|
||||
public class PackIntegrationTest : MSBuildIntegrationTestBase, IClassFixture<BuildServerTestFixture>
|
||||
{
|
||||
private static readonly string TFM = "netcoreapp3.1";
|
||||
private static readonly string TFM = "netcoreapp5.0";
|
||||
|
||||
public PackIntegrationTest(BuildServerTestFixture buildServer)
|
||||
: base(buildServer)
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "Views"), "*.cshtml");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/13303")]
|
||||
[InitializeTestProject("SimpleMvcFSharp", language: "F#")]
|
||||
public async Task Publish_SimpleMvcFSharp_NoopsWithoutFailing()
|
||||
{
|
||||
|
|
@ -434,7 +434,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
var result = await DotnetMSBuild("Publish", "/p:NoBuild=true");
|
||||
|
||||
Assert.BuildFailed(result);
|
||||
Assert.BuildError(result, "MSB3030"); // Could not copy the file "obj/Debug/netcoreapp3.1/SimpleMvc.dll because it couldn't be found.
|
||||
Assert.BuildError(result, "MSB3030"); // Could not copy the file "obj/Debug/netcoreapp5.0/SimpleMvc.dll because it couldn't be found.
|
||||
|
||||
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.dll");
|
||||
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.dll");
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
|
||||
public ITestOutputHelper Output { get; private set; }
|
||||
|
||||
[Fact(Skip = "https://github.com/aspnet/AspNetCore/issues/17233")]
|
||||
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/17233")]
|
||||
[InitializeTestProject("AppWithPackageAndP2PReference",language: "C#", additionalProjects: new[] { "ClassLibrary", "ClassLibrary2" })]
|
||||
public async Task Build_GeneratesStaticWebAssetsManifest_Success_CreatesManifest()
|
||||
{
|
||||
|
|
@ -188,7 +188,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
Assert.FileDoesNotExist(result, IntermediateOutputPath, "staticwebassets", "AppWithPackageAndP2PReference.StaticWebAssets.xml");
|
||||
}
|
||||
|
||||
[Fact(Skip = "https://github.com/aspnet/AspNetCore/issues/17233")]
|
||||
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/17233")]
|
||||
[InitializeTestProject("AppWithPackageAndP2PReference",language: "C#", additionalProjects: new[] { "ClassLibrary", "ClassLibrary2" })]
|
||||
public async Task Rebuild_Success_RecreatesManifestAndCache()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
This is also a partial workaround for https://github.com/Microsoft/msbuild/issues/2661 - this project
|
||||
has netcoreapp dependencies that need to be built first.
|
||||
-->
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
<TargetFramework>netcoreapp5.0</TargetFramework>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<DefineConstants Condition="'$(PreserveWorkingDirectory)'=='true'">$(DefineConstants);PRESERVE_WORKING_DIRECTORY</DefineConstants>
|
||||
<!-- Copy references locally so that we can use them in the test. -->
|
||||
|
|
@ -101,7 +101,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
static partial void InitializeVariables()
|
||||
{
|
||||
_msBuildPath = @"$(_DesktopMSBuildPath)";
|
||||
_microsoftNETCoreApp31PackageVersion = "$(MicrosoftNETCoreApp31PackageVersion)";
|
||||
_MicrosoftNETCoreApp50PackageVersion = "$(MicrosoftNETCoreApp50PackageVersion)";
|
||||
_microsoftNetCompilersToolsetPackageVersion = "$(MicrosoftNetCompilersToolsetPackageVersion)";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.Razor.Tasks
|
|||
[Fact]
|
||||
public void Resolve_Works_WhenAssemblyReferencesAreRecursive()
|
||||
{
|
||||
// Test for https://github.com/aspnet/AspNetCore/issues/12693
|
||||
// Test for https://github.com/dotnet/aspnetcore/issues/12693
|
||||
// Arrange
|
||||
var resolver = new TestReferencesToMvcResolver(new[]
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,6 +14,12 @@
|
|||
<ItemGroup>
|
||||
<!-- Avoid referencing the AspNetCore framework since we want the ability to target work-in-progress shims -->
|
||||
<FrameworkReference Remove="Microsoft.AspNetCore.App" />
|
||||
|
||||
<!-- RID specific installs attempts to restore runtime packs which cause cyclical dependencies .-->
|
||||
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
|
||||
<KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App" />
|
||||
<KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App.WPF" />
|
||||
<KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App.WindowsForms" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(RunningAsTest)' == ''">
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@
|
|||
<Import Project="RazorTest.Introspection.targets" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
The runtime version is only useful to restore and compile test projects, and not used to run tests.
|
||||
We'll keep it pinned to a version that has already been shipped.
|
||||
-->
|
||||
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' ">$(MicrosoftNETCoreAppRefPackageVersion)</RuntimeFrameworkVersion>
|
||||
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' ">$(MicrosoftNETCoreApp50PackageVersion)</RuntimeFrameworkVersion>
|
||||
<!-- aspnet/BuildTools#662 Don't police what version of NetCoreApp we use -->
|
||||
<NETCoreAppMaximumVersion>99.9</NETCoreAppMaximumVersion>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
namespace MvcWithComponents
|
||||
{
|
||||
public class Test
|
||||
{
|
||||
public static string Foo { get; set; }
|
||||
|
||||
public static string Bar { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +1,4 @@
|
|||
@Test.Foo @* Used in a test. Don't remove *@
|
||||
|
||||
NavMenu content
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
using Microsoft.AspNetCore.Razor.TagHelpers;
|
||||
|
||||
// Used for testing purposes to verify multiple TagHelpers applying to a single element.
|
||||
namespace SimpleMvc22.TagHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// I made it!
|
||||
/// </summary>
|
||||
[HtmlTargetElement("environment")]
|
||||
public class EnvironmentTagHelper : TagHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Exclude it!
|
||||
/// </summary>
|
||||
public string Exclude {get; set;}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue