diff --git a/RazorViewCompilation.sln b/RazorViewCompilation.sln index a4b6a2edc1..94efd68599 100644 --- a/RazorViewCompilation.sln +++ b/RazorViewCompilation.sln @@ -13,7 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02F7AA35-91A EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0398AFFF-505E-4283-89DA-BBD9D28B53DB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests", "test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests.csproj", "{46C9A4B2-8B1C-451B-B670-C194901D66AC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests", "test\FunctionalTests\FunctionalTests.csproj", "{46C9A4B2-8B1C-451B-B670-C194901D66AC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test", "test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj", "{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}" EndProject diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/AssemblyMetadataGenerator.cs b/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/AssemblyMetadataGenerator.cs new file mode 100644 index 0000000000..5ebffc4b3f --- /dev/null +++ b/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/AssemblyMetadataGenerator.cs @@ -0,0 +1,46 @@ +// 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.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using Microsoft.AspNetCore.Mvc.Razor.Internal; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.Text; + +namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal +{ + internal static class AssemblyMetadataGenerator + { + public static CSharpCompilation AddAssemblyMetadata( + CSharpCompiler compiler, + CSharpCompilation compilation, + CompilationOptions compilationOptions) + { + if (!string.IsNullOrEmpty(compilationOptions.KeyFile)) + { + var updatedOptions = compilation.Options.WithStrongNameProvider(new DesktopStrongNameProvider()); + var keyFilePath = Path.GetFullPath(compilationOptions.KeyFile); + + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || compilationOptions.PublicSign) + { + updatedOptions = updatedOptions.WithCryptoPublicKey( + SnkUtils.ExtractPublicKey(File.ReadAllBytes(keyFilePath))); + } + else + { + updatedOptions = updatedOptions.WithCryptoKeyFile(keyFilePath) + .WithDelaySign(compilationOptions.DelaySign); + } + + compilation = compilation.WithOptions(updatedOptions); + } + + var applicationAssemblyName = Assembly.Load(new AssemblyName(compilationOptions.ApplicationName)).GetName(); + var assemblyVersionContent = $"[assembly:{typeof(AssemblyVersionAttribute).FullName}(\"{applicationAssemblyName.Version}\")]"; + var syntaxTree = compiler.CreateSyntaxTree(SourceText.From(assemblyVersionContent)); + return compilation.AddSyntaxTrees(syntaxTree); + } + } +} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ManifestGenerator.cs b/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ManifestGenerator.cs deleted file mode 100644 index d29b46e8fc..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ManifestGenerator.cs +++ /dev/null @@ -1,149 +0,0 @@ -// 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.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Text; -using Microsoft.AspNetCore.Mvc.ApplicationParts; -using Microsoft.AspNetCore.Mvc.Razor.Compilation; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.Text; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal -{ - internal class ManifestGenerator - { - public ManifestGenerator( - CSharpCompiler compiler, - CSharpCompilation compilation) - { - Compiler = compiler; - Compilation = compilation; - } - - public CSharpCompiler Compiler { get; } - - public CSharpCompilation Compilation { get; private set; } - - public void GenerateManifest(IList results) - { - var views = new List(); - var pages = new List(); - - for (var i = 0; i < results.Count; i++) - { - var result = results[i]; - if (result.RouteTemplate != null) - { - pages.Add(result); - } - else - { - views.Add(result); - } - } - - GeneratePageManifest(pages); - GenerateViewManifest(views); - } - - private void GenerateViewManifest(IList result) - { - if (result.Count == 0) - { - return; - } - - var precompiledViewsArray = new StringBuilder(); - foreach (var item in result) - { - var path = item.ViewFileInfo.ViewEnginePath; - precompiledViewsArray.AppendLine( - $"new global::{typeof(ViewInfo).FullName}(@\"{path}\", typeof({item.TypeName})),"); - } - - var factoryContent = $@" -namespace {ViewsFeatureProvider.ViewInfoContainerNamespace} -{{ - public class {ViewsFeatureProvider.ViewInfoContainerTypeName} : global::{typeof(ViewInfoContainer).FullName} - {{ - public {ViewsFeatureProvider.ViewInfoContainerTypeName}() : base(new[] - {{ - {precompiledViewsArray} - }}) - {{ - }} - }} -}}"; - var syntaxTree = Compiler.CreateSyntaxTree(SourceText.From(factoryContent)); - Compilation = Compilation.AddSyntaxTrees(syntaxTree); - } - - private void GeneratePageManifest(IList pages) - { - if (pages.Count == 0) - { - return; - } - - var precompiledViewsArray = new StringBuilder(); - foreach (var item in pages) - { - var path = item.ViewFileInfo.ViewEnginePath; - var routeTemplate = item.RouteTemplate; - var escapedRouteTemplate = routeTemplate.Replace("\"", "\\\""); - precompiledViewsArray.AppendLine( - $"new global::{typeof(CompiledPageInfo).FullName}(@\"{path}\", typeof({item.TypeName}), \"{escapedRouteTemplate}\"),"); - } - - var factoryContent = $@" -namespace {CompiledPageFeatureProvider.CompiledPageManifestNamespace} -{{ - public class {CompiledPageFeatureProvider.CompiledPageManifestTypeName} : global::{typeof(CompiledPageManifest).FullName} - {{ - public {CompiledPageFeatureProvider.CompiledPageManifestTypeName}() : base(new[] - {{ - {precompiledViewsArray} - }}) - {{ - }} - }} -}}"; - var syntaxTree = Compiler.CreateSyntaxTree(SourceText.From(factoryContent)); - Compilation = Compilation.AddSyntaxTrees(syntaxTree); - } - - public void AddAssemblyMetadata( - AssemblyName applicationAssemblyName, - CompilationOptions compilationOptions) - { - if (!string.IsNullOrEmpty(compilationOptions.KeyFile)) - { - var updatedOptions = Compilation.Options.WithStrongNameProvider(new DesktopStrongNameProvider()); - var keyFilePath = Path.GetFullPath(compilationOptions.KeyFile); - - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || compilationOptions.PublicSign) - { - updatedOptions = updatedOptions.WithCryptoPublicKey( - SnkUtils.ExtractPublicKey(File.ReadAllBytes(keyFilePath))); - } - else - { - updatedOptions = updatedOptions.WithCryptoKeyFile(keyFilePath) - .WithDelaySign(compilationOptions.DelaySign); - } - - Compilation = Compilation.WithOptions(updatedOptions); - } - - var assemblyVersionContent = $"[assembly:{typeof(AssemblyVersionAttribute).FullName}(\"{applicationAssemblyName.Version}\")]"; - var syntaxTree = Compiler.CreateSyntaxTree(SourceText.From(assemblyVersionContent)); - Compilation = Compilation.AddSyntaxTrees(syntaxTree); - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/PrecompileRunCommand.cs b/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/PrecompileRunCommand.cs index ec573ab023..f09d314214 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/PrecompileRunCommand.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/PrecompileRunCommand.cs @@ -4,18 +4,13 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Razor.Compilation; -using Microsoft.AspNetCore.Mvc.Razor.Extensions; using Microsoft.AspNetCore.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; -using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Emit; using Microsoft.CodeAnalysis.Text; using Microsoft.Extensions.CommandLineUtils; @@ -181,25 +176,17 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal }); compilation = compilation.AddSyntaxTrees(syntaxTrees); - Parallel.For(0, results.Length, ParalellOptions, i => - { - results[i].TypeName = ReadTypeInfo(compilation, syntaxTrees[i]); - }); // Post process the compilation - run ExpressionRewritter and any user specified callbacks. compilation = ExpressionRewriter.Rewrite(compilation); var compilationContext = new RoslynCompilationContext(compilation); MvcServiceProvider.ViewEngineOptions.CompilationCallback(compilationContext); - compilation = compilationContext.Compilation; - - var codeGenerator = new ManifestGenerator(compiler, compilation); - codeGenerator.GenerateManifest(results); - - var assemblyName = new AssemblyName(Options.ApplicationName); - assemblyName = Assembly.Load(assemblyName).GetName(); - codeGenerator.AddAssemblyMetadata(assemblyName, Options); - - return codeGenerator.Compilation; + compilation = AssemblyMetadataGenerator.AddAssemblyMetadata( + compiler, + compilationContext.Compilation, + Options); + + return compilation; } private bool ParseArguments() @@ -247,11 +234,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal compilationInfo = new ViewCompilationInfo(fileInfo, csharpDocument); } - if (PageDirectiveFeature.TryGetPageDirective(fileInfo.CreateReadStream, out var template)) - { - compilationInfo.RouteTemplate = template ?? string.Empty; - } - results[i] = compilationInfo; }); @@ -277,21 +259,5 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal return viewFileInfo; } - - private string ReadTypeInfo(CSharpCompilation compilation, SyntaxTree syntaxTree) - { - var semanticModel = compilation.GetSemanticModel(syntaxTree, ignoreAccessibility: true); - var classDeclarations = syntaxTree.GetRoot().DescendantNodes().OfType(); - foreach (var declaration in classDeclarations) - { - var typeSymbol = semanticModel.GetDeclaredSymbol(declaration); - if (typeSymbol.ContainingType == null && typeSymbol.DeclaredAccessibility == Accessibility.Public) - { - return typeSymbol.ToDisplayString(); - } - } - - return null; - } } } diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ViewCompilationInfo.cs b/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ViewCompilationInfo.cs index 9f1e88d864..8392926f19 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ViewCompilationInfo.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ViewCompilationInfo.cs @@ -1,12 +1,11 @@ // 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 Microsoft.AspNetCore.Mvc.Razor.Extensions; using Microsoft.AspNetCore.Razor.Language; namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal { - internal class ViewCompilationInfo + internal struct ViewCompilationInfo { public ViewCompilationInfo( ViewFileInfo viewFileInfo, @@ -19,9 +18,5 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal public ViewFileInfo ViewFileInfo { get; } public RazorCSharpDocument CSharpDocument { get; } - - public string TypeName { get; set; } - - public string RouteTemplate { get; set; } } } diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationConsumingPrecompiledViews.cs b/test/FunctionalTests/ApplicationConsumingPrecompiledViews.cs similarity index 96% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationConsumingPrecompiledViews.cs rename to test/FunctionalTests/ApplicationConsumingPrecompiledViews.cs index 446ca11291..56f16d4cad 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationConsumingPrecompiledViews.cs +++ b/test/FunctionalTests/ApplicationConsumingPrecompiledViews.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class ApplicationConsumingPrecompiledViews : IClassFixture diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationUsingRelativePathsTest.cs b/test/FunctionalTests/ApplicationUsingRelativePathsTest.cs similarity index 97% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationUsingRelativePathsTest.cs rename to test/FunctionalTests/ApplicationUsingRelativePathsTest.cs index b97f8a4d9e..7a97609ba5 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationUsingRelativePathsTest.cs +++ b/test/FunctionalTests/ApplicationUsingRelativePathsTest.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class ApplicationUsingRelativePathsTest : IClassFixture diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithConfigureMvcTest.cs b/test/FunctionalTests/ApplicationWithConfigureMvcTest.cs similarity index 97% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithConfigureMvcTest.cs rename to test/FunctionalTests/ApplicationWithConfigureMvcTest.cs index fa15a422e2..c87fed2d14 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithConfigureMvcTest.cs +++ b/test/FunctionalTests/ApplicationWithConfigureMvcTest.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class ApplicationWithConfigureMvcTest : IClassFixture diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithCustomInputFilesTest.cs b/test/FunctionalTests/ApplicationWithCustomInputFilesTest.cs similarity index 98% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithCustomInputFilesTest.cs rename to test/FunctionalTests/ApplicationWithCustomInputFilesTest.cs index 2a15442568..364fc37f9f 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithCustomInputFilesTest.cs +++ b/test/FunctionalTests/ApplicationWithCustomInputFilesTest.cs @@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests +namespace FunctionalTests { public class ApplicationWithCustomInputFilesTest : IClassFixture diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithParseErrorsTest.cs b/test/FunctionalTests/ApplicationWithParseErrorsTest.cs similarity index 97% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithParseErrorsTest.cs rename to test/FunctionalTests/ApplicationWithParseErrorsTest.cs index e780770624..5cce007f11 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithParseErrorsTest.cs +++ b/test/FunctionalTests/ApplicationWithParseErrorsTest.cs @@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.Logging.Testing; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class ApplicationWithParseErrorsTest { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithTagHelpersTest.cs b/test/FunctionalTests/ApplicationWithTagHelpersTest.cs similarity index 97% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithTagHelpersTest.cs rename to test/FunctionalTests/ApplicationWithTagHelpersTest.cs index 6a23cc8266..1db1d0540b 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ApplicationWithTagHelpersTest.cs +++ b/test/FunctionalTests/ApplicationWithTagHelpersTest.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class TagHelperTest : IClassFixture { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests.csproj b/test/FunctionalTests/FunctionalTests.csproj similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests.csproj rename to test/FunctionalTests/FunctionalTests.csproj diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/ApplicationPaths.cs b/test/FunctionalTests/Infrastructure/ApplicationPaths.cs similarity index 95% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/ApplicationPaths.cs rename to test/FunctionalTests/Infrastructure/ApplicationPaths.cs index b8d820fb9c..d0b044adb9 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/ApplicationPaths.cs +++ b/test/FunctionalTests/Infrastructure/ApplicationPaths.cs @@ -4,7 +4,7 @@ using System; using System.IO; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public static class ApplicationPaths { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/ApplicationTestFixture.cs b/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs similarity index 98% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/ApplicationTestFixture.cs rename to test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs index 411d06e96a..b5cb8e9434 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/ApplicationTestFixture.cs +++ b/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public abstract class ApplicationTestFixture : IDisposable { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/HttpClientExtensions.cs b/test/FunctionalTests/Infrastructure/HttpClientExtensions.cs similarity index 95% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/HttpClientExtensions.cs rename to test/FunctionalTests/Infrastructure/HttpClientExtensions.cs index bbdb2b6af2..0c9561cde3 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/HttpClientExtensions.cs +++ b/test/FunctionalTests/Infrastructure/HttpClientExtensions.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.Extensions.Logging; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public static class HttpClientExtensions { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/TestEmbeddedResource.cs b/test/FunctionalTests/Infrastructure/TestEmbeddedResource.cs similarity index 97% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/TestEmbeddedResource.cs rename to test/FunctionalTests/Infrastructure/TestEmbeddedResource.cs index feee9544d6..c98cd4c348 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Infrastructure/TestEmbeddedResource.cs +++ b/test/FunctionalTests/Infrastructure/TestEmbeddedResource.cs @@ -5,7 +5,7 @@ using System.IO; using System.Reflection; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public static class TestEmbeddedResource { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Properties/AssemblyInfo.cs b/test/FunctionalTests/Properties/AssemblyInfo.cs similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Properties/AssemblyInfo.cs rename to test/FunctionalTests/Properties/AssemblyInfo.cs diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/PublishWithEmbedViewSourcesTest.cs b/test/FunctionalTests/PublishWithEmbedViewSourcesTest.cs similarity index 97% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/PublishWithEmbedViewSourcesTest.cs rename to test/FunctionalTests/PublishWithEmbedViewSourcesTest.cs index 7cd765048e..6ce51fab2f 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/PublishWithEmbedViewSourcesTest.cs +++ b/test/FunctionalTests/PublishWithEmbedViewSourcesTest.cs @@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests +namespace FunctionalTests { public class PublishWithEmbedViewSourcesTest : IClassFixture diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/RazorPagesAppTest.cs b/test/FunctionalTests/RazorPagesAppTest.cs similarity index 98% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/RazorPagesAppTest.cs rename to test/FunctionalTests/RazorPagesAppTest.cs index 49a3c3cff7..5b6b65e834 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/RazorPagesAppTest.cs +++ b/test/FunctionalTests/RazorPagesAppTest.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class RazorPagesAppTest : IClassFixture { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationConsumingPrecompiledViews.Manage.Home.Index.txt b/test/FunctionalTests/Resources/ApplicationConsumingPrecompiledViews.Manage.Home.Index.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationConsumingPrecompiledViews.Manage.Home.Index.txt rename to test/FunctionalTests/Resources/ApplicationConsumingPrecompiledViews.Manage.Home.Index.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.About.txt b/test/FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.About.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.About.txt rename to test/FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.About.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.Index.txt b/test/FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.Index.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.Index.txt rename to test/FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.Index.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.Index.txt b/test/FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.Index.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.Index.txt rename to test/FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.Index.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.ViewWithPreprocessor.txt b/test/FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.ViewWithPreprocessor.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.ViewWithPreprocessor.txt rename to test/FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.ViewWithPreprocessor.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationWithTagHelpers.Home.ClassLibraryTagHelper.txt b/test/FunctionalTests/Resources/ApplicationWithTagHelpers.Home.ClassLibraryTagHelper.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationWithTagHelpers.Home.ClassLibraryTagHelper.txt rename to test/FunctionalTests/Resources/ApplicationWithTagHelpers.Home.ClassLibraryTagHelper.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationWithTagHelpers.Home.LocalTagHelper.txt b/test/FunctionalTests/Resources/ApplicationWithTagHelpers.Home.LocalTagHelper.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/ApplicationWithTagHelpers.Home.LocalTagHelper.txt rename to test/FunctionalTests/Resources/ApplicationWithTagHelpers.Home.LocalTagHelper.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/RazorPages.Index.txt b/test/FunctionalTests/Resources/RazorPages.Index.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/RazorPages.Index.txt rename to test/FunctionalTests/Resources/RazorPages.Index.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/RazorPages.Nested1.Nested2.PageWithTagHelper.txt b/test/FunctionalTests/Resources/RazorPages.Nested1.Nested2.PageWithTagHelper.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/RazorPages.Nested1.Nested2.PageWithTagHelper.txt rename to test/FunctionalTests/Resources/RazorPages.Nested1.Nested2.PageWithTagHelper.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/RazorPages.PageWithModel.txt b/test/FunctionalTests/Resources/RazorPages.PageWithModel.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/RazorPages.PageWithModel.txt rename to test/FunctionalTests/Resources/RazorPages.PageWithModel.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/RazorPages.PageWithRoute.txt b/test/FunctionalTests/Resources/RazorPages.PageWithRoute.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/RazorPages.PageWithRoute.txt rename to test/FunctionalTests/Resources/RazorPages.PageWithRoute.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/SimpleAppTest.Home.Index.txt b/test/FunctionalTests/Resources/SimpleAppTest.Home.Index.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/SimpleAppTest.Home.Index.txt rename to test/FunctionalTests/Resources/SimpleAppTest.Home.Index.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/SimpleAppWithAssemblyRenameTest.Home.Index.txt b/test/FunctionalTests/Resources/SimpleAppWithAssemblyRenameTest.Home.Index.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/SimpleAppWithAssemblyRenameTest.Home.Index.txt rename to test/FunctionalTests/Resources/SimpleAppWithAssemblyRenameTest.Home.Index.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/StrongNamedApp.Home.Index.txt b/test/FunctionalTests/Resources/StrongNamedApp.Home.Index.txt similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/Resources/StrongNamedApp.Home.Index.txt rename to test/FunctionalTests/Resources/StrongNamedApp.Home.Index.txt diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/RuntimeFlavors.cs b/test/FunctionalTests/RuntimeFlavors.cs similarity index 94% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/RuntimeFlavors.cs rename to test/FunctionalTests/RuntimeFlavors.cs index c1bd137100..e94c200d8f 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/RuntimeFlavors.cs +++ b/test/FunctionalTests/RuntimeFlavors.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; using Microsoft.AspNetCore.Server.IntegrationTesting; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public static class RuntimeFlavors { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/SimpleAppTest.cs b/test/FunctionalTests/SimpleAppTest.cs similarity index 96% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/SimpleAppTest.cs rename to test/FunctionalTests/SimpleAppTest.cs index 6c98f74206..dbbe002ae8 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/SimpleAppTest.cs +++ b/test/FunctionalTests/SimpleAppTest.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class SimpleAppTest : IClassFixture { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/SimpleAppWithAssemblyRenameTest.cs b/test/FunctionalTests/SimpleAppWithAssemblyRenameTest.cs similarity index 97% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/SimpleAppWithAssemblyRenameTest.cs rename to test/FunctionalTests/SimpleAppWithAssemblyRenameTest.cs index ef4ce964db..e11dc55ac2 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/SimpleAppWithAssemblyRenameTest.cs +++ b/test/FunctionalTests/SimpleAppWithAssemblyRenameTest.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class SimpleAppWithAssemblyRenameTest : IClassFixture { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/SimpleAppX86DesktopOnlyTest.cs b/test/FunctionalTests/SimpleAppX86DesktopOnlyTest.cs similarity index 96% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/SimpleAppX86DesktopOnlyTest.cs rename to test/FunctionalTests/SimpleAppX86DesktopOnlyTest.cs index e9cbdfead2..872ce2d37e 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/SimpleAppX86DesktopOnlyTest.cs +++ b/test/FunctionalTests/SimpleAppX86DesktopOnlyTest.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class SimpleAppX86DesktopOnlyTest : IClassFixture { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/StrongNamedAppTest.cs b/test/FunctionalTests/StrongNamedAppTest.cs similarity index 96% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/StrongNamedAppTest.cs rename to test/FunctionalTests/StrongNamedAppTest.cs index 432ba20afc..c8c5018b9c 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/StrongNamedAppTest.cs +++ b/test/FunctionalTests/StrongNamedAppTest.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class StrongNamedAppTest : IClassFixture { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ViewCompilationOptionsTest.cs b/test/FunctionalTests/ViewCompilationOptionsTest.cs similarity index 97% rename from test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ViewCompilationOptionsTest.cs rename to test/FunctionalTests/ViewCompilationOptionsTest.cs index 05267c8988..555f6304f0 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests/ViewCompilationOptionsTest.cs +++ b/test/FunctionalTests/ViewCompilationOptionsTest.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation +namespace FunctionalTests { public class ViewCompilationOptionsTest : IClassFixture {