diff --git a/src/MvcPrecompilation/.gitignore b/src/MvcPrecompilation/.gitignore deleted file mode 100644 index 15a9207874..0000000000 --- a/src/MvcPrecompilation/.gitignore +++ /dev/null @@ -1,43 +0,0 @@ -[Oo]bj/ -[Bb]in/ -TestResults/ -.nuget/ -.build/ -.testPublish/ -*.sln.ide/ -_ReSharper.*/ -packages/ -artifacts/ -PublishProfiles/ -.vs/ -.vscode/ -bower_components/ -node_modules/ -debugSettings.json -project.lock.json -*.user -*.suo -*.cache -*.docstates -_ReSharper.* -nuget.exe -*net45.csproj -*net451.csproj -*k10.csproj -*.psess -*.vsp -*.pidb -*.userprefs -*DS_Store -*.ncrunchsolution -*.*sdf -*.ipch -.settings -*.sln.ide -node_modules -*launchSettings.json -*.orig -BuildInfo.generated.cs -msbuild.log -msbuild.binlog -global.json diff --git a/src/MvcPrecompilation/Directory.Build.props b/src/MvcPrecompilation/Directory.Build.props deleted file mode 100644 index a73e31b984..0000000000 --- a/src/MvcPrecompilation/Directory.Build.props +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - Microsoft ASP.NET Core - https://github.com/aspnet/AspNetCore - git - $(MSBuildThisFileDirectory) - $(MSBuildThisFileDirectory)build\Key.snk - true - true - - diff --git a/src/MvcPrecompilation/Directory.Build.targets b/src/MvcPrecompilation/Directory.Build.targets deleted file mode 100644 index 78626b773e..0000000000 --- a/src/MvcPrecompilation/Directory.Build.targets +++ /dev/null @@ -1,10 +0,0 @@ - - - $(MicrosoftNETCoreApp20PackageVersion) - $(MicrosoftNETCoreApp21PackageVersion) - $(MicrosoftNETCoreApp22PackageVersion) - $(NETStandardLibrary20PackageVersion) - - 99.9 - - diff --git a/src/MvcPrecompilation/NuGetPackageVerifier.json b/src/MvcPrecompilation/NuGetPackageVerifier.json deleted file mode 100644 index d69d587620..0000000000 --- a/src/MvcPrecompilation/NuGetPackageVerifier.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "adx": { - "rules": [ - "DefaultCompositeRule" - ], - "packages": { - "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation": { - "exclusions": { - "BUILD_ITEMS_FRAMEWORK": { - "*": "Purposefully creating a netstandard2.0 build item so our targets can be injected for desktop and non-desktop based projects." - } - } - } - } - }, - "Default": { - "rules": [ - "DefaultCompositeRule" - ] - } -} \ No newline at end of file diff --git a/src/MvcPrecompilation/README.md b/src/MvcPrecompilation/README.md deleted file mode 100644 index 49eca511c4..0000000000 --- a/src/MvcPrecompilation/README.md +++ /dev/null @@ -1,55 +0,0 @@ - -ASP.NET Core MVC Precompilation -=== - -## NOTE: This repo is solely for maintenance of the existing MVC precompilation feature. Future work on Razor compilation is now being handled in the [Razor](https://github.com/aspnet/razor) repo. See [aspnet/Razor#1740](https://github.com/aspnet/Razor/issues/1740) for additional details. - -AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/jx955ph2045dw1w0/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/mvcprecompilation/branch/dev) -Travis: [![Travis](https://travis-ci.org/aspnet/MvcPrecompilation.svg?branch=dev)](https://travis-ci.org/aspnet/mvcprecompilation) - -The Razor syntax provides a fast, terse, clean, and lightweight way to combine server code with HTML to create dynamic web content. This repo contains tooling that allows compilation of MVC Razor views as part of build and publish. - -## Installation and usage - -### Referencing the `Microsoft.AspNetCore.Mvc.Razor.ViewCompilation` package -* If you're targeting ASP.NET Core 2.0 or higher on netcoreapp2.0, a reference to the `Microsoft.AspNetCore.Mvc.Razor.ViewCompilation` package is added by `Microsoft.AspNetCore.All` and you do not need to explicitly reference it. -* For desktop targeting projects or projects targeting ASP.NET Core 1.x, add a package reference to the appropriate version of `Microsoft.AspNetCore.Mvc.Razor.ViewCompilation` in your project: - -```xml - - - -``` - -### Enabling view compilation -View compilation as part of publishing is enabled by default if you're referencing the Web SDK (`Microsoft.NET.Sdk.Web`) that ships with .NET Core 2.0 or later versions. For older versions, add the `MvcRazorCompileOnPublish` property to your project: - -```xml - - true - -``` - -Alternatively, you may wire up the `MvcRazorPrecompile` target to a build event: -```xml - -``` - -## Options - -Some aspects of view compilation can be configured by editing the project: - -* `MvcRazorCompileOnPublish`: Setting this to `false` turns off all functions of view compilation that are enabled as part of publishing. - -* `MvcRazorExcludeViewFilesFromPublish`: Enabling `MvcRazorCompileOnPublish` prevents .cshtml files from being published. This option disables this behavior. -Note: ASP.NET Core Mvc does not support updateable precompiled views. Any modifications to published cshtml files will be ignored if a precompiled view is discovered for that path. - -* `MvcRazorExcludeRefAssembliesFromPublish`: Enabling `MvcRazorCompileOnPublish` causes the target to prevent the `refs` directory from being published. This option disables this behavior. -Note: Setting this option is useful if your application is using a mix of precompiled and runtime compiled views. - -* `MvcRazorFilesToCompile`: An item group that specifies view files to compile. By default this includes all .cshtml files marked as content. - -This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. diff --git a/src/MvcPrecompilation/RazorViewCompilation.sln b/src/MvcPrecompilation/RazorViewCompilation.sln deleted file mode 100644 index 83963166a3..0000000000 --- a/src/MvcPrecompilation/RazorViewCompilation.sln +++ /dev/null @@ -1,312 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2036 -MinimumVisualStudioVersion = 15.0.26730.03 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation", "src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.csproj", "{4339FC9B-AEC6-442A-B413-A41555ED76C7}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFiles", "SolutionFiles", "{01707B64-7DC7-4B5A-B0BB-7CD2773AA297}" - ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - Directory.Build.targets = Directory.Build.targets - NuGet.config = NuGet.config - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02F7AA35-91AF-491E-9F0E-03CFAF86C720}" - ProjectSection(SolutionItems) = preProject - src\Directory.Build.props = src\Directory.Build.props - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0398AFFF-505E-4283-89DA-BBD9D28B53DB}" - ProjectSection(SolutionItems) = preProject - test\Directory.Build.props = test\Directory.Build.props - EndProjectSection -EndProject -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 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{87FEE984-F627-4F1E-8995-E5F969B85A19}" - ProjectSection(SolutionItems) = preProject - build\dependencies.props = build\dependencies.props - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testapps", "testapps", "{0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7}" - ProjectSection(SolutionItems) = preProject - testapps\Directory.Build.props = testapps\Directory.Build.props - testapps\Directory.Build.targets = testapps\Directory.Build.targets - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleApp", "testapps\SimpleApp\SimpleApp.csproj", "{8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleAppWithAssemblyRename", "testapps\SimpleAppWithAssemblyRename\SimpleAppWithAssemblyRename.csproj", "{D5677246-BC78-426D-9233-0313A04C6D92}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PublishWithEmbedViewSources", "testapps\PublishWithEmbedViewSources\PublishWithEmbedViewSources.csproj", "{7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongNamedApp", "testapps\StrongNamedApp\StrongNamedApp.csproj", "{87C6A03D-1655-4D1C-82E5-8F553BF4096D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithParseErrors", "testapps\ApplicationWithParseErrors\ApplicationWithParseErrors.csproj", "{AF647059-B86B-46DD-9559-E1324A39B148}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithConfigureMvc", "testapps\ApplicationWithConfigureMvc\ApplicationWithConfigureMvc.csproj", "{559FBB83-40BC-47AF-A224-312CF8E3629B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithCustomInputFiles", "testapps\ApplicationWithCustomInputFiles\ApplicationWithCustomInputFiles.csproj", "{8F73A290-BCE1-461A-9970-397FFBFCC902}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassLibraryTagHelper", "testapps\ClassLibraryTagHelper\ClassLibraryTagHelper.csproj", "{196EF313-71CB-47A9-A77D-AACAF62881A1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithTagHelpers", "testapps\ApplicationWithTagHelpers\ApplicationWithTagHelpers.csproj", "{08552602-37E7-48A7-95A2-BB1A1F57C804}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RazorPagesApp", "testapps\RazorPagesApp\RazorPagesApp.csproj", "{779BACC4-B20E-4F73-A9C7-350443CF1941}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{75244EBD-DFBD-4C4B-9543-C135AC142C7F}" - ProjectSection(SolutionItems) = preProject - tools\Directory.Build.props = tools\Directory.Build.props - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks", "src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.csproj", "{996D4DEB-1701-435E-8048-1E65790C2050}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithRazorSdkNeitherUsed", "testapps\ApplicationWithRazorSdkNeitherUsed\ApplicationWithRazorSdkNeitherUsed.csproj", "{B64D2B9C-5737-4A39-AA46-27757F345B1E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithRazorSdkPrecompilationUsed", "testapps\ApplicationWithRazorSdkPrecompilationUsed\ApplicationWithRazorSdkPrecompilationUsed.csproj", "{3147D272-E8E8-404D-A62C-35CD2C71FC05}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithRazorSdkUsed", "testapps\ApplicationWithRazorSdkUsed\ApplicationWithRazorSdkUsed.csproj", "{FAA20AFB-1B2E-4A0B-A421-B83741C81644}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|x64.ActiveCfg = Debug|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|x64.Build.0 = Debug|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|x86.ActiveCfg = Debug|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|x86.Build.0 = Debug|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|Any CPU.Build.0 = Release|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|x64.ActiveCfg = Release|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|x64.Build.0 = Release|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|x86.ActiveCfg = Release|Any CPU - {4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|x86.Build.0 = Release|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|x64.ActiveCfg = Debug|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|x64.Build.0 = Debug|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|x86.ActiveCfg = Debug|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|x86.Build.0 = Debug|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|Any CPU.Build.0 = Release|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|x64.ActiveCfg = Release|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|x64.Build.0 = Release|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|x86.ActiveCfg = Release|Any CPU - {46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|x86.Build.0 = Release|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|x64.ActiveCfg = Debug|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|x64.Build.0 = Debug|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|x86.ActiveCfg = Debug|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|x86.Build.0 = Debug|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|Any CPU.Build.0 = Release|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x64.ActiveCfg = Release|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x64.Build.0 = Release|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x86.ActiveCfg = Release|Any CPU - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x86.Build.0 = Release|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Debug|x64.ActiveCfg = Debug|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Debug|x64.Build.0 = Debug|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Debug|x86.ActiveCfg = Debug|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Debug|x86.Build.0 = Debug|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Release|Any CPU.Build.0 = Release|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Release|x64.ActiveCfg = Release|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Release|x64.Build.0 = Release|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Release|x86.ActiveCfg = Release|Any CPU - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0}.Release|x86.Build.0 = Release|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Debug|x64.ActiveCfg = Debug|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Debug|x64.Build.0 = Debug|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Debug|x86.ActiveCfg = Debug|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Debug|x86.Build.0 = Debug|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Release|Any CPU.Build.0 = Release|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Release|x64.ActiveCfg = Release|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Release|x64.Build.0 = Release|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Release|x86.ActiveCfg = Release|Any CPU - {D5677246-BC78-426D-9233-0313A04C6D92}.Release|x86.Build.0 = Release|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Debug|x64.ActiveCfg = Debug|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Debug|x64.Build.0 = Debug|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Debug|x86.ActiveCfg = Debug|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Debug|x86.Build.0 = Debug|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Release|Any CPU.Build.0 = Release|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Release|x64.ActiveCfg = Release|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Release|x64.Build.0 = Release|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Release|x86.ActiveCfg = Release|Any CPU - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94}.Release|x86.Build.0 = Release|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Debug|x64.ActiveCfg = Debug|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Debug|x64.Build.0 = Debug|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Debug|x86.ActiveCfg = Debug|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Debug|x86.Build.0 = Debug|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Release|Any CPU.Build.0 = Release|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Release|x64.ActiveCfg = Release|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Release|x64.Build.0 = Release|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Release|x86.ActiveCfg = Release|Any CPU - {87C6A03D-1655-4D1C-82E5-8F553BF4096D}.Release|x86.Build.0 = Release|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Debug|x64.ActiveCfg = Debug|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Debug|x64.Build.0 = Debug|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Debug|x86.ActiveCfg = Debug|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Debug|x86.Build.0 = Debug|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Release|Any CPU.Build.0 = Release|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Release|x64.ActiveCfg = Release|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Release|x64.Build.0 = Release|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Release|x86.ActiveCfg = Release|Any CPU - {AF647059-B86B-46DD-9559-E1324A39B148}.Release|x86.Build.0 = Release|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Debug|x64.ActiveCfg = Debug|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Debug|x64.Build.0 = Debug|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Debug|x86.ActiveCfg = Debug|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Debug|x86.Build.0 = Debug|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Release|Any CPU.Build.0 = Release|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Release|x64.ActiveCfg = Release|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Release|x64.Build.0 = Release|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Release|x86.ActiveCfg = Release|Any CPU - {559FBB83-40BC-47AF-A224-312CF8E3629B}.Release|x86.Build.0 = Release|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Debug|x64.ActiveCfg = Debug|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Debug|x64.Build.0 = Debug|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Debug|x86.ActiveCfg = Debug|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Debug|x86.Build.0 = Debug|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Release|Any CPU.Build.0 = Release|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Release|x64.ActiveCfg = Release|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Release|x64.Build.0 = Release|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Release|x86.ActiveCfg = Release|Any CPU - {8F73A290-BCE1-461A-9970-397FFBFCC902}.Release|x86.Build.0 = Release|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Debug|x64.ActiveCfg = Debug|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Debug|x64.Build.0 = Debug|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Debug|x86.ActiveCfg = Debug|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Debug|x86.Build.0 = Debug|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Release|Any CPU.Build.0 = Release|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Release|x64.ActiveCfg = Release|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Release|x64.Build.0 = Release|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Release|x86.ActiveCfg = Release|Any CPU - {196EF313-71CB-47A9-A77D-AACAF62881A1}.Release|x86.Build.0 = Release|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Debug|Any CPU.Build.0 = Debug|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Debug|x64.ActiveCfg = Debug|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Debug|x64.Build.0 = Debug|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Debug|x86.ActiveCfg = Debug|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Debug|x86.Build.0 = Debug|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Release|Any CPU.ActiveCfg = Release|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Release|Any CPU.Build.0 = Release|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Release|x64.ActiveCfg = Release|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Release|x64.Build.0 = Release|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Release|x86.ActiveCfg = Release|Any CPU - {08552602-37E7-48A7-95A2-BB1A1F57C804}.Release|x86.Build.0 = Release|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Debug|Any CPU.Build.0 = Debug|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Debug|x64.ActiveCfg = Debug|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Debug|x64.Build.0 = Debug|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Debug|x86.ActiveCfg = Debug|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Debug|x86.Build.0 = Debug|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Release|Any CPU.ActiveCfg = Release|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Release|Any CPU.Build.0 = Release|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Release|x64.ActiveCfg = Release|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Release|x64.Build.0 = Release|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Release|x86.ActiveCfg = Release|Any CPU - {779BACC4-B20E-4F73-A9C7-350443CF1941}.Release|x86.Build.0 = Release|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Debug|Any CPU.Build.0 = Debug|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Debug|x64.ActiveCfg = Debug|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Debug|x64.Build.0 = Debug|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Debug|x86.ActiveCfg = Debug|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Debug|x86.Build.0 = Debug|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Release|Any CPU.ActiveCfg = Release|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Release|Any CPU.Build.0 = Release|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Release|x64.ActiveCfg = Release|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Release|x64.Build.0 = Release|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Release|x86.ActiveCfg = Release|Any CPU - {996D4DEB-1701-435E-8048-1E65790C2050}.Release|x86.Build.0 = Release|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Debug|x64.ActiveCfg = Debug|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Debug|x64.Build.0 = Debug|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Debug|x86.ActiveCfg = Debug|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Debug|x86.Build.0 = Debug|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Release|Any CPU.Build.0 = Release|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Release|x64.ActiveCfg = Release|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Release|x64.Build.0 = Release|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Release|x86.ActiveCfg = Release|Any CPU - {B64D2B9C-5737-4A39-AA46-27757F345B1E}.Release|x86.Build.0 = Release|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Debug|x64.ActiveCfg = Debug|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Debug|x64.Build.0 = Debug|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Debug|x86.ActiveCfg = Debug|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Debug|x86.Build.0 = Debug|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Release|Any CPU.Build.0 = Release|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Release|x64.ActiveCfg = Release|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Release|x64.Build.0 = Release|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Release|x86.ActiveCfg = Release|Any CPU - {3147D272-E8E8-404D-A62C-35CD2C71FC05}.Release|x86.Build.0 = Release|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Debug|x64.ActiveCfg = Debug|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Debug|x64.Build.0 = Debug|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Debug|x86.ActiveCfg = Debug|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Debug|x86.Build.0 = Debug|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Release|Any CPU.Build.0 = Release|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Release|x64.ActiveCfg = Release|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Release|x64.Build.0 = Release|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Release|x86.ActiveCfg = Release|Any CPU - {FAA20AFB-1B2E-4A0B-A421-B83741C81644}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {4339FC9B-AEC6-442A-B413-A41555ED76C7} = {02F7AA35-91AF-491E-9F0E-03CFAF86C720} - {46C9A4B2-8B1C-451B-B670-C194901D66AC} = {0398AFFF-505E-4283-89DA-BBD9D28B53DB} - {E0D75B4E-839F-4F80-9B1F-B33F616BCC5F} = {0398AFFF-505E-4283-89DA-BBD9D28B53DB} - {8B7C86DF-FA69-4F3F-A22B-6BFCCBBCEDE0} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {D5677246-BC78-426D-9233-0313A04C6D92} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {7EFC460A-8BAA-4538-8EBE-0B3BB6101E94} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {87C6A03D-1655-4D1C-82E5-8F553BF4096D} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {AF647059-B86B-46DD-9559-E1324A39B148} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {559FBB83-40BC-47AF-A224-312CF8E3629B} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {8F73A290-BCE1-461A-9970-397FFBFCC902} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {196EF313-71CB-47A9-A77D-AACAF62881A1} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {08552602-37E7-48A7-95A2-BB1A1F57C804} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {779BACC4-B20E-4F73-A9C7-350443CF1941} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {996D4DEB-1701-435E-8048-1E65790C2050} = {02F7AA35-91AF-491E-9F0E-03CFAF86C720} - {B64D2B9C-5737-4A39-AA46-27757F345B1E} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {3147D272-E8E8-404D-A62C-35CD2C71FC05} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - {FAA20AFB-1B2E-4A0B-A421-B83741C81644} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {177268A1-F5B2-451E-8ABE-BEF0C572481A} - EndGlobalSection -EndGlobal diff --git a/src/MvcPrecompilation/build/Key.snk b/src/MvcPrecompilation/build/Key.snk deleted file mode 100644 index e10e4889c1..0000000000 Binary files a/src/MvcPrecompilation/build/Key.snk and /dev/null differ diff --git a/src/MvcPrecompilation/build/dependencies.props b/src/MvcPrecompilation/build/dependencies.props deleted file mode 100644 index ce13502d7f..0000000000 --- a/src/MvcPrecompilation/build/dependencies.props +++ /dev/null @@ -1,33 +0,0 @@ - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - 3.0.0-alpha1-20180821.3 - 3.0.0-alpha1-10352 - 3.0.0-alpha1-10352 - 3.0.0-alpha1-10352 - 3.0.0-alpha1-10352 - 3.0.0-alpha1-10352 - 3.0.0-alpha1-10352 - 0.7.0-alpha1-10352 - 3.0.0-alpha1-10352 - 3.0.0-alpha1-10352 - 15.6.82 - 3.0.0-alpha1-10352 - 3.0.0-alpha1-10352 - 3.0.0-alpha1-10352 - 3.0.0-alpha1-10352 - 3.0.0-alpha1-10352 - 2.0.9 - 2.1.2 - 2.2.0-preview1-26618-02 - 3.0.0-preview-18579-0056 - 15.6.1 - 2.0.3 - 2.3.1 - 2.4.0 - - - - diff --git a/src/MvcPrecompilation/build/repo.props b/src/MvcPrecompilation/build/repo.props deleted file mode 100644 index e3e0fa123b..0000000000 --- a/src/MvcPrecompilation/build/repo.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/MvcPrecompilation/build/sources.props b/src/MvcPrecompilation/build/sources.props deleted file mode 100644 index 9215df9751..0000000000 --- a/src/MvcPrecompilation/build/sources.props +++ /dev/null @@ -1,17 +0,0 @@ - - - - - $(DotNetRestoreSources) - - $(RestoreSources); - https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; - https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; - - - $(RestoreSources); - https://api.nuget.org/v3/index.json; - - - diff --git a/src/MvcPrecompilation/src/Directory.Build.props b/src/MvcPrecompilation/src/Directory.Build.props deleted file mode 100644 index 1e0980f663..0000000000 --- a/src/MvcPrecompilation/src/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks/GetDotNetHost.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks/GetDotNetHost.cs deleted file mode 100644 index 36f6b3fdd3..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks/GetDotNetHost.cs +++ /dev/null @@ -1,21 +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 Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Microsoft.Extensions.CommandLineUtils; - -namespace Microsoft.AspNetCore.BuildTools -{ - public class GetDotNetHost : Task - { - [Output] - public string MuxerPath { get; set; } - - public override bool Execute() - { - MuxerPath = DotNetMuxer.MuxerPathOrDefault(); - return true; - } - } -} diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.csproj b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.csproj deleted file mode 100644 index 7afcec3de8..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - Microsoft Build Tasks supporting Razor view compilation. - netstandard2.0 - false - false - - - - - - - - diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/AssemblyMetadataGenerator.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/AssemblyMetadataGenerator.cs deleted file mode 100644 index 5ebffc4b3f..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/AssemblyMetadataGenerator.cs +++ /dev/null @@ -1,46 +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.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/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/CompilationOptions.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/CompilationOptions.cs deleted file mode 100644 index 4adc9b3db7..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/CompilationOptions.cs +++ /dev/null @@ -1,105 +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 Microsoft.Extensions.CommandLineUtils; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal -{ - internal class CompilationOptions - { - public static readonly string ConfigureCompilationTypeTemplate = "--configure-compilation-type"; - public static readonly string ContentRootTemplate = "--content-root"; - public static readonly string EmbedViewSourceTemplate = "--embed-view-sources"; - public static readonly string StrongNameKeyPath = "--key-file"; - public static readonly string DelaySignTemplate = "--delay-sign"; - public static readonly string PublicSignTemplate = "--public-sign"; - public static readonly string ApplicationNameTemplate = "--application-name"; - public static readonly string OutputPathTemplate = "--output-path"; - public static readonly string ViewsToCompileTemplate = "--file"; - - public CompilationOptions(CommandLineApplication app) - { - OutputPathOption = app.Option( - OutputPathTemplate, - "Path to the emit the precompiled assembly to.", - CommandOptionType.SingleValue); - - ApplicationNameOption = app.Option( - ApplicationNameTemplate, - "Name of the application to produce precompiled assembly for.", - CommandOptionType.SingleValue); - - ProjectArgument = app.Argument( - "project", - "The path to the project file."); - - ConfigureCompilationType = app.Option( - ConfigureCompilationTypeTemplate, - "Type with Configure method", - CommandOptionType.SingleValue); - - ContentRootOption = app.Option( - ContentRootTemplate, - "The application's content root.", - CommandOptionType.SingleValue); - - EmbedViewSourcesOption = app.Option( - EmbedViewSourceTemplate, - "Embed view sources as resources in the generated assembly.", - CommandOptionType.NoValue); - - KeyFileOption = app.Option( - StrongNameKeyPath, - "Strong name key path.", - CommandOptionType.SingleValue); - - DelaySignOption = app.Option( - DelaySignTemplate, - "Determines if the precompiled view assembly is to be delay signed.", - CommandOptionType.NoValue); - - PublicSignOption = app.Option( - PublicSignTemplate, - "Determines if the precompiled view assembly is to be public signed.", - CommandOptionType.NoValue); - - ViewsToCompileOption = app.Option( - ViewsToCompileTemplate, - "Razor files to compile.", - CommandOptionType.MultipleValue); - } - - public CommandArgument ProjectArgument { get; } - - public CommandOption ConfigureCompilationType { get; } - - public CommandOption ContentRootOption { get; } - - public CommandOption EmbedViewSourcesOption { get; } - - public CommandOption KeyFileOption { get; } - - public CommandOption DelaySignOption { get; } - - public CommandOption PublicSignOption { get; } - - public CommandOption OutputPathOption { get; } - - public CommandOption ApplicationNameOption { get; } - - public CommandOption ViewsToCompileOption { get; } - - public string OutputPath => OutputPathOption.Value(); - - public string ApplicationName => ApplicationNameOption.Value(); - - public string KeyFile => KeyFileOption.Value(); - - public bool DelaySign => DelaySignOption.HasValue(); - - public bool PublicSign => PublicSignOption.HasValue(); - - public List ViewsToCompile => ViewsToCompileOption.Values; - } -} diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/DebugHelper.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/DebugHelper.cs deleted file mode 100644 index 518b4318e6..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/DebugHelper.cs +++ /dev/null @@ -1,25 +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. - -#if DEBUG -using System; -using System.Diagnostics; -using System.Linq; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal -{ - internal static class DebugHelper - { - public static void HandleDebugSwitch(ref string[] args) - { - if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase)) - { - args = args.Skip(1).ToArray(); - Console.WriteLine("Waiting for debugger to attach. Press ENTER to continue"); - Console.WriteLine($"Process ID: {Process.GetCurrentProcess().Id}"); - Console.ReadLine(); - } - } - } -} -#endif \ No newline at end of file diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/MvcServiceProvider.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/MvcServiceProvider.cs deleted file mode 100644 index 625956abb5..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/MvcServiceProvider.cs +++ /dev/null @@ -1,124 +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; -using System.Diagnostics; -using System.Linq; -using System.Reflection; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Hosting.Internal; -using Microsoft.AspNetCore.Mvc.Internal; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Mvc.Razor.Extensions; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.FileProviders; -using Microsoft.Extensions.ObjectPool; -using Microsoft.Extensions.Options; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal -{ - internal class MvcServiceProvider - { - private readonly string _projectPath; - private readonly string _contentRoot; - private readonly string _applicationName; - - public MvcServiceProvider( - string projectPath, - string applicationName, - string contentRoot, - string configureCompilationType) - { - _projectPath = projectPath; - _contentRoot = contentRoot; - _applicationName = applicationName; - - var mvcBuilderConfiguration = GetConfigureCompilationAction(configureCompilationType); - var serviceProvider = GetProvider(mvcBuilderConfiguration); - - Engine = serviceProvider.GetRequiredService(); - TemplateEngine = new MvcRazorTemplateEngine(Engine, serviceProvider.GetRequiredService()) - { - Options = - { - ImportsFileName = "_ViewImports.cshtml", - } - }; - Compiler = serviceProvider.GetRequiredService(); - ViewEngineOptions = serviceProvider.GetRequiredService>().Value; - } - - public MvcRazorTemplateEngine TemplateEngine { get; } - - public RazorEngine Engine { get; } - - public CSharpCompiler Compiler { get; } - - public RazorViewEngineOptions ViewEngineOptions { get; } - - private IDesignTimeMvcBuilderConfiguration GetConfigureCompilationAction(string configureCompilationType) - { - Type type; - if (!string.IsNullOrEmpty(configureCompilationType)) - { - type = Type.GetType(configureCompilationType); - if (type == null) - { - throw new InvalidOperationException($"Unable to find type '{type}."); - } - } - else - { - var assemblyName = new AssemblyName(_applicationName); - var assembly = Assembly.Load(assemblyName); - type = assembly - .GetExportedTypes() - .FirstOrDefault(typeof(IDesignTimeMvcBuilderConfiguration).IsAssignableFrom); - } - - if (type == null) - { - return null; - } - - var instance = Activator.CreateInstance(type) as IDesignTimeMvcBuilderConfiguration; - if (instance == null) - { - throw new InvalidOperationException($"Type {configureCompilationType} does not implement " + - $"{typeof(IDesignTimeMvcBuilderConfiguration)}."); - } - - return instance; - } - - private IServiceProvider GetProvider(IDesignTimeMvcBuilderConfiguration mvcBuilderConfiguration) - { - var services = new ServiceCollection(); - - var hostingEnvironment = new HostingEnvironment - { - ApplicationName = _applicationName, - WebRootFileProvider = new PhysicalFileProvider(_projectPath), - ContentRootFileProvider = new PhysicalFileProvider(_contentRoot), - ContentRootPath = _contentRoot, - }; - var diagnosticSource = new DiagnosticListener("Microsoft.AspNetCore"); - - services - .AddSingleton(hostingEnvironment) - .AddSingleton(diagnosticSource) - .AddLogging() - .AddSingleton(); - - var mvcCoreBuilder = services - .AddMvcCore() - .AddRazorViewEngine(); - - var mvcBuilder = new MvcBuilder(mvcCoreBuilder.Services, mvcCoreBuilder.PartManager); - mvcBuilderConfiguration?.ConfigureMvc(mvcBuilder); - - return mvcBuilder.Services.BuildServiceProvider(); - } - } -} diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/PrecompilationApplication.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/PrecompilationApplication.cs deleted file mode 100644 index b4c9246beb..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/PrecompilationApplication.cs +++ /dev/null @@ -1,80 +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; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using Microsoft.Extensions.CommandLineUtils; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal -{ - internal class PrecompilationApplication : CommandLineApplication - { - private readonly Type _callingType; - - public PrecompilationApplication(Type callingType) - { - _callingType = callingType; - - Name = "razor-precompile"; - FullName = "Microsoft Razor Precompilation Utility"; - Description = "Precompiles Razor views."; - ShortVersionGetter = GetInformationalVersion; - - HelpOption("-?|-h|--help"); - - OnExecute(() => - { - ShowHelp(); - return 2; - }); - } - - public new int Execute(params string[] args) - { - try - { - return base.Execute(ExpandResponseFiles(args)); - } - catch (AggregateException ex) when (ex.InnerException != null) - { - Error.WriteLine(ex.InnerException.Message); - Error.WriteLine(ex.InnerException.StackTrace); - return 1; - } - catch (Exception ex) - { - Error.WriteLine(ex.Message); - Error.WriteLine(ex.StackTrace); - return 1; - } - } - - private string GetInformationalVersion() - { - var assembly = _callingType.GetTypeInfo().Assembly; - var attribute = assembly.GetCustomAttribute(); - return attribute.InformationalVersion; - } - - private static string[] ExpandResponseFiles(string[] args) - { - var expandedArgs = new List(); - foreach (var arg in args) - { - if (!arg.StartsWith("@", StringComparison.Ordinal)) - { - expandedArgs.Add(arg); - } - else - { - var fileName = arg.Substring(1); - expandedArgs.AddRange(File.ReadLines(fileName)); - } - } - - return expandedArgs.ToArray(); - } - } -} diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/PrecompileRunCommand.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/PrecompileRunCommand.cs deleted file mode 100644 index 3203d8d39b..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/PrecompileRunCommand.cs +++ /dev/null @@ -1,264 +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; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Razor.Compilation; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.Emit; -using Microsoft.CodeAnalysis.Text; -using Microsoft.Extensions.CommandLineUtils; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal -{ - internal class PrecompileRunCommand - { - private static readonly ParallelOptions ParalellOptions = new ParallelOptions - { - MaxDegreeOfParallelism = 4 - }; - - private CommandLineApplication Application { get; set; } - - private MvcServiceProvider MvcServiceProvider { get; set; } - - private CompilationOptions Options { get; set; } - - private string ProjectPath { get; set; } - - public void Configure(CommandLineApplication app) - { - Application = app; - Options = new CompilationOptions(app); - - app.OnExecute(() => Execute()); - } - - private int Execute() - { - if (!ParseArguments()) - { - return 1; - } - - MvcServiceProvider = new MvcServiceProvider( - ProjectPath, - Options.ApplicationNameOption.Value(), - Options.ContentRootOption.Value(), - Options.ConfigureCompilationType.Value()); - - var results = GenerateCode(); - var success = true; - - foreach (var result in results) - { - if (result.CSharpDocument.Diagnostics.Count > 0) - { - success = false; - foreach (var error in result.CSharpDocument.Diagnostics) - { - Application.Error.WriteLine($"{result.ViewFileInfo.FullPath} ({error.Span.LineIndex}): {error.GetMessage()}"); - } - } - } - - if (!success) - { - return 1; - } - - var precompileAssemblyName = $"{Options.ApplicationName}.PrecompiledViews"; - var compilation = CompileViews(results, precompileAssemblyName); - var resources = GetResources(results); - - var assemblyPath = Path.Combine(Options.OutputPath, precompileAssemblyName + ".dll"); - var emitResult = EmitAssembly( - compilation, - MvcServiceProvider.Compiler.EmitOptions, - assemblyPath, - resources); - - if (!emitResult.Success) - { - foreach (var diagnostic in emitResult.Diagnostics) - { - Application.Error.WriteLine(CSharpDiagnosticFormatter.Instance.Format(diagnostic)); - } - - return 1; - } - - return 0; - } - - private ResourceDescription[] GetResources(ViewCompilationInfo[] results) - { - if (!Options.EmbedViewSourcesOption.HasValue()) - { - return new ResourceDescription[0]; - } - - var resources = new ResourceDescription[results.Length]; - for (var i = 0; i < results.Length; i++) - { - var fileInfo = results[i].ViewFileInfo; - - resources[i] = new ResourceDescription( - fileInfo.ViewEnginePath, - fileInfo.CreateReadStream, - isPublic: true); - } - - return resources; - } - - public EmitResult EmitAssembly( - CSharpCompilation compilation, - EmitOptions emitOptions, - string assemblyPath, - ResourceDescription[] resources) - { - EmitResult emitResult; - using (var assemblyStream = new MemoryStream()) - { - using (var pdbStream = new MemoryStream()) - { - emitResult = compilation.Emit( - assemblyStream, - pdbStream, - manifestResources: resources, - options: emitOptions); - - if (emitResult.Success) - { - Directory.CreateDirectory(Path.GetDirectoryName(assemblyPath)); - var pdbPath = Path.ChangeExtension(assemblyPath, ".pdb"); - assemblyStream.Position = 0; - pdbStream.Position = 0; - - // Avoid writing to disk unless the compilation is successful. - using (var assemblyFileStream = File.OpenWrite(assemblyPath)) - { - assemblyStream.CopyTo(assemblyFileStream); - } - - using (var pdbFileStream = File.OpenWrite(pdbPath)) - { - pdbStream.CopyTo(pdbFileStream); - } - } - } - } - - return emitResult; - } - - private CSharpCompilation CompileViews(ViewCompilationInfo[] results, string assemblyname) - { - var compiler = MvcServiceProvider.Compiler; - var compilation = compiler.CreateCompilation(assemblyname); - var syntaxTrees = new SyntaxTree[results.Length]; - - Parallel.For(0, results.Length, ParalellOptions, i => - { - var result = results[i]; - var sourceText = SourceText.From(result.CSharpDocument.GeneratedCode, Encoding.UTF8); - var fileInfo = result.ViewFileInfo; - var syntaxTree = compiler.CreateSyntaxTree(sourceText) - .WithFilePath(fileInfo.FullPath ?? fileInfo.ViewEnginePath); - syntaxTrees[i] = syntaxTree; - }); - - compilation = compilation.AddSyntaxTrees(syntaxTrees); - - // Post process the compilation - run ExpressionRewritter and any user specified callbacks. - compilation = ExpressionRewriter.Rewrite(compilation); - var compilationContext = new RoslynCompilationContext(compilation); -#pragma warning disable CS0618 // Type or member is obsolete - MvcServiceProvider.ViewEngineOptions.CompilationCallback(compilationContext); -#pragma warning restore CS0618 // Type or member is obsolete - compilation = AssemblyMetadataGenerator.AddAssemblyMetadata( - compiler, - compilationContext.Compilation, - Options); - - return compilation; - } - - private bool ParseArguments() - { - ProjectPath = Options.ProjectArgument.Value; - if (string.IsNullOrEmpty(ProjectPath)) - { - Application.Error.WriteLine("Project path not specified."); - return false; - } - - if (!Options.OutputPathOption.HasValue()) - { - Application.Error.WriteLine($"Option {CompilationOptions.OutputPathTemplate} does not specify a value."); - return false; - } - - if (!Options.ApplicationNameOption.HasValue()) - { - Application.Error.WriteLine($"Option {CompilationOptions.ApplicationNameTemplate} does not specify a value."); - return false; - } - - if (!Options.ContentRootOption.HasValue()) - { - Application.Error.WriteLine($"Option {CompilationOptions.ContentRootTemplate} does not specify a value."); - return false; - } - - return true; - } - - private ViewCompilationInfo[] GenerateCode() - { - var files = GetRazorFiles(); - var results = new ViewCompilationInfo[files.Count]; - Parallel.For(0, results.Length, ParalellOptions, i => - { - var fileInfo = files[i]; - var templateEngine = MvcServiceProvider.TemplateEngine; - ViewCompilationInfo compilationInfo; - using (var fileStream = fileInfo.CreateReadStream()) - { - var csharpDocument = templateEngine.GenerateCode(fileInfo.ViewEnginePath); - compilationInfo = new ViewCompilationInfo(fileInfo, csharpDocument); - } - - results[i] = compilationInfo; - }); - - return results; - } - - private List GetRazorFiles() - { - var contentRoot = Options.ContentRootOption.Value(); - var viewFiles = Options.ViewsToCompile; - var viewFileInfo = new List(viewFiles.Count); - var trimLength = contentRoot.EndsWith("/") ? contentRoot.Length - 1 : contentRoot.Length; - - for (var i = 0; i < viewFiles.Count; i++) - { - var fullPath = viewFiles[i]; - if (fullPath.StartsWith(contentRoot, StringComparison.OrdinalIgnoreCase)) - { - var viewEnginePath = fullPath.Substring(trimLength).Replace('\\', '/'); - viewFileInfo.Add(new ViewFileInfo(fullPath, viewEnginePath)); - } - } - - return viewFileInfo; - } - } -} diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/SnkUtils.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/SnkUtils.cs deleted file mode 100644 index 6e06878277..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/SnkUtils.cs +++ /dev/null @@ -1,88 +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; -using System.Collections.Immutable; -using System.IO; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal -{ - // Copied from https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.DotNet.ProjectModel.Workspaces/SnkUtils.cs - internal static class SnkUtils - { - const byte PUBLICKEYBLOB = 0x06; - const byte PRIVATEKEYBLOB = 0x07; - - private const uint CALG_RSA_SIGN = 0x00002400; - private const uint CALG_SHA = 0x00008004; - - private const uint RSA1 = 0x31415352; //"RSA1" publickeyblob - private const uint RSA2 = 0x32415352; //"RSA2" privatekeyblob - - private const int VersionOffset = 1; - private const int ModulusLengthOffset = 12; - private const int ExponentOffset = 16; - private const int MagicPrivateKeyOffset = 8; - private const int MagicPublicKeyOffset = 20; - - public static ImmutableArray ExtractPublicKey(byte[] snk) - { - ValidateBlob(snk); - - if (snk[0] != PRIVATEKEYBLOB) - { - return ImmutableArray.Create(snk); - } - - var version = snk[VersionOffset]; - int modulusBitLength = ReadInt32(snk, ModulusLengthOffset); - uint exponent = (uint)ReadInt32(snk, ExponentOffset); - var modulus = new byte[modulusBitLength >> 3]; - - Array.Copy(snk, 20, modulus, 0, modulus.Length); - - return CreatePublicKey(version, exponent, modulus); - } - - private static void ValidateBlob(byte[] snk) - { - // 160 - the size of public key - if (snk.Length >= 160) - { - if (snk[0] == PRIVATEKEYBLOB && ReadInt32(snk, MagicPrivateKeyOffset) == RSA2 || // valid private key - snk[12] == PUBLICKEYBLOB && ReadInt32(snk, MagicPublicKeyOffset) == RSA1) // valid public key - { - return; - } - } - - throw new InvalidOperationException("Invalid key file."); - } - - private static int ReadInt32(byte[] array, int index) - { - return array[index] | array[index + 1] << 8 | array[index + 2] << 16 | array[index + 3] << 24; - } - - private static ImmutableArray CreatePublicKey(byte version, uint exponent, byte[] modulus) - { - using (var ms = new MemoryStream(160)) - using (var binaryWriter = new BinaryWriter(ms)) - { - binaryWriter.Write(CALG_RSA_SIGN); - binaryWriter.Write(CALG_SHA); - // total size of the rest of the blob (20 - size of RSAPUBKEY) - binaryWriter.Write(modulus.Length + 20); - binaryWriter.Write(PUBLICKEYBLOB); - binaryWriter.Write(version); - binaryWriter.Write((ushort)0x00000000); // reserved - binaryWriter.Write(CALG_RSA_SIGN); - binaryWriter.Write(RSA1); - binaryWriter.Write(modulus.Length << 3); - binaryWriter.Write(exponent); - binaryWriter.Write(modulus); - return ImmutableArray.Create(ms.ToArray()); - } - } - } -} \ No newline at end of file diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ViewCompilationInfo.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ViewCompilationInfo.cs deleted file mode 100644 index 8392926f19..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ViewCompilationInfo.cs +++ /dev/null @@ -1,22 +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 Microsoft.AspNetCore.Razor.Language; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal -{ - internal struct ViewCompilationInfo - { - public ViewCompilationInfo( - ViewFileInfo viewFileInfo, - RazorCSharpDocument cSharpDocument) - { - ViewFileInfo = viewFileInfo; - CSharpDocument = cSharpDocument; - } - - public ViewFileInfo ViewFileInfo { get; } - - public RazorCSharpDocument CSharpDocument { get; } - } -} diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ViewFileInfo.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ViewFileInfo.cs deleted file mode 100644 index 56e0586525..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Internal/ViewFileInfo.cs +++ /dev/null @@ -1,34 +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.IO; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal -{ - internal struct ViewFileInfo - { - public ViewFileInfo(string fullPath, string viewEnginePath) - { - FullPath = fullPath; - ViewEnginePath = viewEnginePath; - } - - public string FullPath { get; } - - public string ViewEnginePath { get; } - - public Stream CreateReadStream() - { - // We are setting buffer size to 1 to prevent FileStream from allocating it's internal buffer - // 0 causes constructor to throw - var bufferSize = 1; - return new FileStream( - FullPath, - FileMode.Open, - FileAccess.Read, - FileShare.ReadWrite, - bufferSize, - FileOptions.Asynchronous | FileOptions.SequentialScan); - } - } -} diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.csproj b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.csproj deleted file mode 100644 index 9574c695d3..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - Build-time references required to enable Razor view compilation as part of building the application. - netcoreapp2.0;net461 - - cshtml;razor;compilation;precompilation;aspnetcore - true - exe - ..\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\ - false - false - $(MSBuildProjectName).nuspec - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - unknown - - - id=$(PackageId); - version=$(PackageVersion); - authors=$(Authors); - MicrosoftAspNetCoreHostingPackageVersion=$(MicrosoftAspNetCoreHostingPackageVersion); - MicrosoftAspNetCoreMvcRazorPagesPackageVersion=$(MicrosoftAspNetCoreMvcRazorPagesPackageVersion); - description=$(Description); - tags=$(PackageTags.Replace(';', ' ')); - licenseUrl=$(PackageLicenseUrl); - projectUrl=$(PackageProjectUrl); - iconUrl=$(PackageIconUrl); - repositoryUrl=$(RepositoryUrl); - repositoryCommit=$(RepositoryCommit); - copyright=$(Copyright); - AssemblyName=$(AssemblyName); - - OutputBinary=$(OutputPath)netcoreapp2.0\$(AssemblyName).dll; - OutputSymbol=$(OutputPath)netcoreapp2.0\$(AssemblyName).pdb; - TaskBinary=$(TasksProjectDirectory)bin\$(Configuration)\netstandard2.0\$(AssemblyName).Tasks.dll; - TaskSymbol=$(TasksProjectDirectory)bin\$(Configuration)\netstandard2.0\$(AssemblyName).Tasks.pdb; - - OutputExeX86=$(OutputPath)net461\$(AssemblyName)-x86.exe; - OutputExeSymbolX86=$(OutputPath)net461\$(AssemblyName)-x86.pdb; - OutputExeAnyCPU=$(OutputPath)net461\$(AssemblyName).exe; - OutputExeSymbolAnyCPU=$(OutputPath)net461\$(AssemblyName).pdb; - - - - diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.nuspec b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.nuspec deleted file mode 100644 index f687c38c61..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.nuspec +++ /dev/null @@ -1,42 +0,0 @@ - - - - $id$ - $version$ - $authors$ - true - $licenseUrl$ - $projectUrl$ - $iconUrl$ - $description$ - $copyright$ - $tags$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Program.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Program.cs deleted file mode 100644 index 0b4b532c93..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Program.cs +++ /dev/null @@ -1,24 +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; -using Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation -{ - internal class Program - { - private readonly static Type ProgramType = typeof(Program); - - public static int Main(string[] args) - { -#if DEBUG - DebugHelper.HandleDebugSwitch(ref args); -#endif - - var app = new PrecompilationApplication(ProgramType); - new PrecompileRunCommand().Configure(app); - return app.Execute(args); - } - } -} diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Properties/AssemblyInfo.cs b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Properties/AssemblyInfo.cs deleted file mode 100644 index 44f26e88db..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +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.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] - diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/baseline.netcore.json b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/baseline.netcore.json deleted file mode 100644 index 3dbc1895c8..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/baseline.netcore.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [] -} \ No newline at end of file diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/build/netstandard2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/build/netstandard2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets deleted file mode 100644 index 7ce2043073..0000000000 --- a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/build/netstandard2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - $(IntermediateOutputPath) - <_MvcRazorOutputFullPath Condition="'$(_MvcRazorOutputFullPath)'==''">$([MSBuild]::EnsureTrailingSlash('$(MvcRazorOutputPath)'))$(AssemblyName).PrecompiledViews.dll - <_MvcRazorResponseFilePath>$(IntermediateOutputPath)microsoft.aspnetcore.mvc.razor.viewcompilation.rsp - - $(MSBuildProjectDirectory) - true - true - - - - - - - - - - - - - - - - - <_MvcViewCompilationTasksPath Condition="'$(_MvcViewCompilationTasksPath)'==''">$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Tasks.dll - - - - - - - - - - - - - dotnet - <_MvcViewCompilationBinariesDir Condition="'$(_MvcViewCompilationBinariesDir)' == ''">$(MSBuildThisFileDirectory) - <_MvcViewCompilationBinaryPath>$(_MvcViewCompilationBinariesDir)netcoreapp2.0\$(MSBuildThisFileName).dll - - "$(MvcRazorRunCommand)" exec - $(ExecArgs) --runtimeconfig "$(ProjectRuntimeConfigFilePath)" - $(ExecArgs) --depsfile "$(ProjectDepsFilePath)" - $(ExecArgs) "$(_MvcViewCompilationBinaryPath)" - $(ExecArgs) @"$(_MvcRazorResponseFilePath)" - - - - - - - - - <_RazorCompilationProject Include="$(MSBuildProjectFullPath)"> - RuntimeIdentifier=;MvcRazorOutputPath=$(MvcRazorOutputPath) - - - - - - - - - <_MvcViewCompilationBinariesDir Condition="'$(_MvcViewCompilationBinariesDir)' == ''">$(MSBuildThisFileDirectory) - - <_MvcViewCompilationBinaryPath Condition="'$(PlatformTarget)'=='x86'">$(_MvcViewCompilationBinariesDir)net461\$(MSBuildThisFileName)-x86.exe - <_MvcViewCompilationBinaryPath Condition="'$(PlatformTarget)'!='x86'">$(_MvcViewCompilationBinariesDir)net461\$(MSBuildThisFileName).exe - - - - - - - - - - - - - - <_MvcViewCompilationBinaryName>$([System.IO.Path]::GetFileName('$(_MvcViewCompilationBinaryPath)')) - - - - <_PreCompilationFilesToCopy - Include="$(OutputPath)$(AssemblyName).exe.config" - Destination="$(OutputPath)$(_MvcViewCompilationBinaryName).config" /> - - <_PreCompilationFilesToCopy - Include="$(_MvcViewCompilationBinaryPath)" - Destination="$(OutputPath)$(_MvcViewCompilationBinaryName)" /> - - - - $(OutputPath)$(_MvcViewCompilationBinaryName) - - - - - - - - - - - - <_ResponseFileLines Include=" - $(MSBuildProjectDirectory); - --output-path=$(MvcRazorOutputPath); - --application-name=$(AssemblyName); - --content-root=$(MvcRazorContentRoot);" /> - - <_ResponseFileLines - Condition="'$(MvcRazorEmbedViewSources)'=='true'" - Include="--embed-view-sources" /> - - <_ResponseFileLines Include="--file=%(MvcRazorFilesToCompile.FullPath)" /> - - - - <_ResponseFileLines - Condition="'$(DelaySign)'=='true'" - Include="--delay-sign" /> - <_ResponseFileLines - Condition="'$(PublicSign)'=='true'" - Include="--public-sign" /> - <_ResponseFileLines Include="--key-file=$(AssemblyOriginatorKeyFile)" /> - - - - - - - - - - - <_MvcRazorOutputPdbFullPath>$([System.IO.Path]::ChangeExtension('$(_MvcRazorOutputFullPath)', '.pdb')) - - - - - - - $([System.IO.Path]::GetFileName('$(_MvcRazorOutputFullPath)')) - - - - $([System.IO.Path]::GetFileName('$(_MvcRazorOutputPdbFullPath)')) - - - - - - - - - diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/lib/net461/_._ b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/lib/net461/_._ deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/lib/netcoreapp2.0/_._ b/src/MvcPrecompilation/src/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation/lib/netcoreapp2.0/_._ deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/MvcPrecompilation/test/Directory.Build.props b/src/MvcPrecompilation/test/Directory.Build.props deleted file mode 100644 index bf1f6628de..0000000000 --- a/src/MvcPrecompilation/test/Directory.Build.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - - netcoreapp2.2 - $(DeveloperBuildTestTfms) - - $(StandardTestTfms);net461 - - - - - - - - - - diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithConfigureMvcTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithConfigureMvcTest_CoreCLR.cs deleted file mode 100644 index 0916f7af1e..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithConfigureMvcTest_CoreCLR.cs +++ /dev/null @@ -1,62 +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.Threading.Tasks; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class ApplicationWithConfigureMvcTest_CoreCLR - : LoggedTest, IClassFixture> - { - public ApplicationWithConfigureMvcTest_CoreCLR( - CoreCLRApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task Precompilation_RunsConfiguredCompilationCallbacks() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("ApplicationWithConfigureMvc.Home.Index.txt", response); - } - } - - [Fact] - public async Task Precompilation_UsesConfiguredParseOptions() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/ViewWithPreprocessor", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent( - "ApplicationWithConfigureMvc.Home.ViewWithPreprocessor.txt", - response); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs deleted file mode 100644 index bce4f0a260..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs +++ /dev/null @@ -1,105 +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; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class ApplicationWithCustomInputFilesTest_CoreCLR - : LoggedTest, IClassFixture> - { - public ApplicationWithCustomInputFilesTest_CoreCLR( - CoreCLRApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task ApplicationWithCustomInputFiles_Works() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var expectedText = "Hello Index!"; - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - Assert.Equal(expectedText, response.Trim()); - } - } - - [Fact] - public async Task MvcRazorFilesToCompile_OverridesTheFilesToBeCompiled() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var expectedViews = new[] - { - "/Views/Home/About.cshtml", - "/Views/Home/Index.cshtml", - }; - - // Act - var response2 = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/GetPrecompiledResourceNames", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - var actual = response2.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) - .OrderBy(p => p, StringComparer.OrdinalIgnoreCase); - Assert.Equal(expectedViews, actual); - } - } - - [Fact] - public async Task MvcRazorFilesToCompile_SpecificallyDoesNotPublishFilesToBeCompiled() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var viewsNotPublished = new[] - { - "Index.cshtml", - "About.cshtml", - }; - - var viewsPublished = new[] - { - "NotIncluded.cshtml", - }; - var viewsDirectory = Path.Combine(deployment.ContentRoot, "Views", "Home"); - - // Act & Assert - foreach (var file in viewsPublished) - { - var filePath = Path.Combine(viewsDirectory, file); - Assert.True(File.Exists(filePath), $"{filePath} was not published."); - } - - foreach (var file in viewsNotPublished) - { - var filePath = Path.Combine(viewsDirectory, file); - Assert.False(File.Exists(filePath), $"{filePath} was published."); - } - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithParseErrorsTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithParseErrorsTest_CoreCLR.cs deleted file mode 100644 index ce66f29457..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithParseErrorsTest_CoreCLR.cs +++ /dev/null @@ -1,49 +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; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging.Testing; -using Xunit; - -namespace FunctionalTests -{ - public class ApplicationWithParseErrorsTest_CoreCLR - : IClassFixture> - { - public ApplicationWithParseErrorsTest_CoreCLR(CoreCLRApplicationTestFixture fixture) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact(Skip = "Flaky test in many build configurations. See issue #277.")] - public async Task PublishingPrintsParseErrors() - { - // Arrange - var indexPath = Path.Combine(Fixture.TestProjectDirectory, "Views", "Home", "Index.cshtml"); - var viewImportsPath = Path.Combine(Fixture.TestProjectDirectory, "Views", "Home", "About.cshtml"); - var expectedErrors = new[] - { - indexPath + " (0): The code block is missing a closing \"}\" character. Make sure you have a matching \"}\" character for all the \"{\" characters within this block, and that none of the \"}\" characters are being interpreted as markup.", - viewImportsPath + " (1): A space or line break was encountered after the \"@\" character. Only valid identifiers, keywords, comments, \"(\" and \"{\" are valid at the start of a code block and they must occur immediately following \"@\" with no space in between.", - - }; - var testSink = new TestSink(); - var loggerFactory = new TestLoggerFactory(testSink, enabled: true); - - // Act - await Assert.ThrowsAsync(() => Fixture.CreateDeploymentAsync(loggerFactory)); - - // Assert - var logs = testSink.Writes.Select(w => w.State.ToString().Trim()).ToList(); - foreach (var expectedError in expectedErrors) - { - Assert.Contains(logs, log => log.Contains(expectedError)); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithTagHelpersTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithTagHelpersTest_CoreCLR.cs deleted file mode 100644 index 3f42c7c1c7..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ApplicationWithTagHelpersTest_CoreCLR.cs +++ /dev/null @@ -1,75 +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.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class ApplicationWithTagHelpersTest_CoreCLR : - LoggedTest, IClassFixture - { - public ApplicationWithTagHelpersTest_CoreCLR( - ApplicationWithTagHelpersTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task Precompilation_WorksForViewsThatUseTagHelpersFromProjectReferences() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/ClassLibraryTagHelper", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent($"ApplicationWithTagHelpers.Home.ClassLibraryTagHelper.txt", response); - } - } - - [Fact] - public async Task Precompilation_WorksForViewsThatUseTagHelpersFromCurrentProject() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/LocalTagHelper", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent($"ApplicationWithTagHelpers.Home.LocalTagHelper.txt", response); - } - } - - public class ApplicationWithTagHelpersTestFixture : CoreCLRApplicationTestFixture - { - protected override Task CreateDeploymentAsyncCore(ILoggerFactory loggerFactory) - { - CopyDirectory( - new DirectoryInfo(Path.Combine(ApplicationPath, "..", "ClassLibraryTagHelper")), - new DirectoryInfo(Path.Combine(WorkingDirectory, "ClassLibraryTagHelper"))); - - return base.CreateDeploymentAsyncCore(loggerFactory); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/CoreCLRApplicationTestFixture.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/CoreCLRApplicationTestFixture.cs deleted file mode 100644 index 8deadfcef7..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/CoreCLRApplicationTestFixture.cs +++ /dev/null @@ -1,29 +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 Microsoft.AspNetCore.Server.IntegrationTesting; - -namespace FunctionalTests -{ - public class CoreCLRApplicationTestFixture : ApplicationTestFixture - { - private const string TargetFramework = -#if NETCOREAPP2_2 - "netcoreapp2.2"; -#else -#error Target frameworks need to be updated -#endif - - public CoreCLRApplicationTestFixture() - : this(typeof(TStartup).Assembly.GetName().Name, null) - { - } - - protected CoreCLRApplicationTestFixture(string applicationName, string applicationPath) - : base(applicationName, applicationPath) - { - } - - protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.CoreClr, TargetFramework); - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs deleted file mode 100644 index b6a3e54ae7..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs +++ /dev/null @@ -1,62 +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; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class PublishWithEmbedViewSourcesTest_CoreCLR - : LoggedTest, IClassFixture> - { - public PublishWithEmbedViewSourcesTest_CoreCLR( - CoreCLRApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task Precompilation_CanEmbedViewSourcesAsResources() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var logger = loggerFactory.CreateLogger(Fixture.ApplicationName); - var expectedViews = new[] - { - "/Areas/TestArea/Views/Home/Index.cshtml", - "/Views/Home/About.cshtml", - "/Views/Home/Index.cshtml", - }; - var expectedText = "Hello Index!"; - - // Act - 1 - var response1 = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/Index", - logger); - - // Assert - 1 - Assert.Equal(expectedText, response1.Trim()); - - // Act - 2 - var response2 = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/GetPrecompiledResourceNames", - logger); - - // Assert - 2 - var actual = response2.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) - .OrderBy(p => p, StringComparer.OrdinalIgnoreCase); - Assert.Equal(expectedViews, actual); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorPagesAppTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorPagesAppTest_CoreCLR.cs deleted file mode 100644 index 9c9a107cb8..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorPagesAppTest_CoreCLR.cs +++ /dev/null @@ -1,134 +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.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class RazorPagesAppTest_CoreCLR : - LoggedTest, IClassFixture> - { - public RazorPagesAppTest_CoreCLR( - CoreCLRApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact(Skip = "https://github.com/aspnet/MvcPrecompilation/issues/287")] - public async Task Precompilation_WorksForIndexPage_UsingFolderName() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "/", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("RazorPages.Index.txt", response); - } - } - - [Fact(Skip = "https://github.com/aspnet/MvcPrecompilation/issues/287")] - public async Task Precompilation_WorksForIndexPage_UsingFileName() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "/Index", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("RazorPages.Index.txt", response); - } - } - - [Fact(Skip = "https://github.com/aspnet/MvcPrecompilation/issues/287")] - public async Task Precompilation_WorksForPageWithModel() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "/PageWithModel?person=Dan", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("RazorPages.PageWithModel.txt", response); - } - } - - [Fact(Skip = "https://github.com/aspnet/MvcPrecompilation/issues/287")] - public async Task Precompilation_WorksForPageWithRoute() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "/PageWithRoute/Dan", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("RazorPages.PageWithRoute.txt", response); - } - } - - [Fact(Skip = "https://github.com/aspnet/MvcPrecompilation/issues/287")] - public async Task Precompilation_WorksForPageInNestedFolder() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "/Nested1/Nested2/PageWithTagHelper", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("RazorPages.Nested1.Nested2.PageWithTagHelper.txt", response); - } - } - - [Fact(Skip = "https://github.com/aspnet/MvcPrecompilation/issues/287")] - public async Task Precompilation_WorksWithPageConventions() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await RetryHelper.RetryRequest( - () => deployment.HttpClient.GetAsync("/Auth/Index"), - loggerFactory.CreateLogger(Fixture.ApplicationName), - retryCount: 5); - - // Assert - Assert.Equal("/Login?ReturnUrl=%2FAuth%2FIndex", response.RequestMessage.RequestUri.PathAndQuery); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorSdkNeitherUsedTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorSdkNeitherUsedTest_CoreCLR.cs deleted file mode 100644 index faea04ab38..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorSdkNeitherUsedTest_CoreCLR.cs +++ /dev/null @@ -1,46 +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.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - // Tests that cover cases where both Razor SDK and MvcPrecompilation are installed. This is the default in 2.1 - public class RazorSdkNeitherUsedTest_CoreCLR : LoggedTest, IClassFixture> - { - public RazorSdkNeitherUsedTest_CoreCLR( - CoreCLRApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task Publish_HasNoPrecompilation() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await RetryHelper.RetryRequest( - () => deployment.HttpClient.GetAsync(deployment.ApplicationBaseUri), - loggerFactory.CreateLogger(Fixture.ApplicationName), - retryCount: 5); - - // Assert - Assert.False(File.Exists(Path.Combine(deployment.ContentRoot, "ApplicationWithRazorSdkNeitherUsed.PrecompiledViews.dll"))); - Assert.False(File.Exists(Path.Combine(deployment.ContentRoot, "ApplicationWithRazorSdkNeitherUsed.Views.dll"))); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorSdkPrecompilationUsedTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorSdkPrecompilationUsedTest_CoreCLR.cs deleted file mode 100644 index 130553d855..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorSdkPrecompilationUsedTest_CoreCLR.cs +++ /dev/null @@ -1,45 +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.IO; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - // Tests that cover cases where both Razor SDK and MvcPrecompilation are installed. This is the default in 2.1 - public class RazorSdkPrecompilationUsedTest_CoreCLR : LoggedTest, IClassFixture> - { - public RazorSdkPrecompilationUsedTest_CoreCLR( - CoreCLRApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task Publish_UsesRazorSDK() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - Assert.True(File.Exists(Path.Combine(deployment.ContentRoot, "ApplicationWithRazorSdkPrecompilationUsed.PrecompiledViews.dll"))); - Assert.False(File.Exists(Path.Combine(deployment.ContentRoot, "ApplicationWithRazorSdkPrecompilationUsed.Views.dll"))); - TestEmbeddedResource.AssertContent("ApplicationWithRazorSdkPrecompilationUsed.Home.Index.txt", response); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorSdkUsedTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorSdkUsedTest_CoreCLR.cs deleted file mode 100644 index 6f1a4ff918..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/RazorSdkUsedTest_CoreCLR.cs +++ /dev/null @@ -1,47 +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.IO; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - // Tests that cover cases where both Razor SDK and MvcPrecompilation are installed. This is the default in 2.1 - public class RazorSdkUsedTest_CoreCLR : LoggedTest, IClassFixture> - { - public RazorSdkUsedTest_CoreCLR( - CoreCLRApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task Publish_UsesRazorSDK() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var expectedViewLocation = Path.Combine(deployment.ContentRoot, "ApplicationWithRazorSdkUsed.Views.dll"); - var expectedPrecompiledViewsLocation = Path.Combine(deployment.ContentRoot, "ApplicationWithRazorSdkUsed.PrecompiledViews.dll"); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - Assert.False(File.Exists(expectedPrecompiledViewsLocation), $"{expectedPrecompiledViewsLocation} existed, but shouldn't have."); - Assert.True(File.Exists(expectedViewLocation), $"{expectedViewLocation} didn't exist."); - TestEmbeddedResource.AssertContent("ApplicationWithRazorSdkUsed.Home.Index.txt", response); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs deleted file mode 100644 index 18e17b588e..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs +++ /dev/null @@ -1,42 +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.Threading.Tasks; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class SimpleAppTest_CoreCLR : - LoggedTest, IClassFixture> - { - public SimpleAppTest_CoreCLR( - CoreCLRApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task Precompilation_WorksForSimpleApps() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs deleted file mode 100644 index dddd8cf097..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs +++ /dev/null @@ -1,52 +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.Threading.Tasks; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class SimpleAppWithAssemblyRenameTest_CoreCLR : - LoggedTest, IClassFixture - { - public SimpleAppWithAssemblyRenameTest_CoreCLR( - TestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task Precompilation_WorksForSimpleApps() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("SimpleAppWithAssemblyRenameTest.Home.Index.txt", response); - } - } - - public class TestFixture : CoreCLRApplicationTestFixture - { - public TestFixture() - : base( - typeof(SimpleAppWithAssemblyRename.Startup).Assembly.GetName().Name, - ApplicationPaths.GetTestAppDirectory(nameof(SimpleAppWithAssemblyRename))) - { - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/StrongNamedAppTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/StrongNamedAppTest_CoreCLR.cs deleted file mode 100644 index 4559a416fa..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/StrongNamedAppTest_CoreCLR.cs +++ /dev/null @@ -1,42 +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.Threading.Tasks; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class StrongNamedAppTest_CoreCLR : - LoggedTest, IClassFixture> - { - public StrongNamedAppTest_CoreCLR( - CoreCLRApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task PrecompiledAssembliesUseSameStrongNameAsApplication() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("StrongNamedApp.Home.Index.txt", response); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ViewCompilationOptionsTest_CoreCLR.cs b/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ViewCompilationOptionsTest_CoreCLR.cs deleted file mode 100644 index 6b80eca31d..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/CoreCLRTests/ViewCompilationOptionsTest_CoreCLR.cs +++ /dev/null @@ -1,57 +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.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class ViewCompilationOptions_CoreCLR_ScenarioRefAssembliesDoNotGetPublished : - LoggedTest, IClassFixture - { - public ViewCompilationOptions_CoreCLR_ScenarioRefAssembliesDoNotGetPublished( - TestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task PublishingWithOption_AllowsPublishingRefAssemblies() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act & Assert - Assert.True(Directory.Exists(Path.Combine(deployment.ContentRoot, "refs"))); - } - } - - public class TestFixture : CoreCLRApplicationTestFixture - { - public TestFixture() - { - PublishOnly = true; - } - - protected override DeploymentParameters GetDeploymentParameters() - { - var deploymentParameters = base.GetDeploymentParameters(); - deploymentParameters.PublishEnvironmentVariables.Add( - new KeyValuePair("MvcRazorExcludeRefAssembliesFromPublish", "false")); - - return deploymentParameters; - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithConfigureMvcTest_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithConfigureMvcTest_Desktop.cs deleted file mode 100644 index 5e2db02762..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithConfigureMvcTest_Desktop.cs +++ /dev/null @@ -1,65 +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.Threading.Tasks; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class ApplicationWithConfigureMvcTest_Desktop - : LoggedTest, IClassFixture> - { - public ApplicationWithConfigureMvcTest_Desktop( - DesktopApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task Precompilation_RunsConfiguredCompilationCallbacks() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("ApplicationWithConfigureMvc.Home.Index.txt", response); - } - } - - [ConditionalFact] - public async Task Precompilation_UsesConfiguredParseOptions() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/ViewWithPreprocessor", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent( - "ApplicationWithConfigureMvc.Home.ViewWithPreprocessor.txt", - response); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithCustomInputFilesTest_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithCustomInputFilesTest_Desktop.cs deleted file mode 100644 index cd519e5518..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithCustomInputFilesTest_Desktop.cs +++ /dev/null @@ -1,108 +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; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class ApplicationWithCustomInputFilesTest_Desktop - : LoggedTest, IClassFixture> - { - public ApplicationWithCustomInputFilesTest_Desktop( - DesktopApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task ApplicationWithCustomInputFiles_Works() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var expectedText = "Hello Index!"; - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - Assert.Equal(expectedText, response.Trim()); - } - } - - [ConditionalFact] - public async Task MvcRazorFilesToCompile_OverridesTheFilesToBeCompiled() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var expectedViews = new[] - { - "/Views/Home/About.cshtml", - "/Views/Home/Index.cshtml", - }; - - // Act - var response2 = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/GetPrecompiledResourceNames", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - var actual = response2.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) - .OrderBy(p => p, StringComparer.OrdinalIgnoreCase); - Assert.Equal(expectedViews, actual); - } - } - - [ConditionalFact] - public async Task MvcRazorFilesToCompile_SpecificallyDoesNotPublishFilesToBeCompiled() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var viewsNotPublished = new[] - { - "Index.cshtml", - "About.cshtml", - }; - - var viewsPublished = new[] - { - "NotIncluded.cshtml", - }; - var viewsDirectory = Path.Combine(deployment.ContentRoot, "Views", "Home"); - - // Act & Assert - foreach (var file in viewsPublished) - { - var filePath = Path.Combine(viewsDirectory, file); - Assert.True(File.Exists(filePath), $"{filePath} was not published."); - } - - foreach (var file in viewsNotPublished) - { - var filePath = Path.Combine(viewsDirectory, file); - Assert.False(File.Exists(filePath), $"{filePath} was published."); - } - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithParseErrorsTest_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithParseErrorsTest_Desktop.cs deleted file mode 100644 index 7c6d9a9835..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithParseErrorsTest_Desktop.cs +++ /dev/null @@ -1,52 +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; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; -using Xunit; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class ApplicationWithParseErrorsTest_Desktop - : IClassFixture> - { - public ApplicationWithParseErrorsTest_Desktop(DesktopApplicationTestFixture fixture) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact(Skip = "Flaky test in many build configurations.See issue #277.")] - public async Task PublishingPrintsParseErrors() - { - // Arrange - var indexPath = Path.Combine(Fixture.TestProjectDirectory, "Views", "Home", "Index.cshtml"); - var viewImportsPath = Path.Combine(Fixture.TestProjectDirectory, "Views", "Home", "About.cshtml"); - var expectedErrors = new[] - { - indexPath + " (0): The code block is missing a closing \"}\" character. Make sure you have a matching \"}\" character for all the \"{\" characters within this block, and that none of the \"}\" characters are being interpreted as markup.", - viewImportsPath + " (1): A space or line break was encountered after the \"@\" character. Only valid identifiers, keywords, comments, \"(\" and \"{\" are valid at the start of a code block and they must occur immediately following \"@\" with no space in between.", - - }; - var testSink = new TestSink(); - var loggerFactory = new TestLoggerFactory(testSink, enabled: true); - - // Act - await Assert.ThrowsAsync(() => Fixture.CreateDeploymentAsync(loggerFactory)); - - // Assert - var logs = testSink.Writes.Select(w => w.State.ToString().Trim()).ToList(); - foreach (var expectedError in expectedErrors) - { - Assert.Contains(logs, log => log.Contains(expectedError)); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithTagHelpersTest_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithTagHelpersTest_Desktop.cs deleted file mode 100644 index 68d661e2d8..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ApplicationWithTagHelpersTest_Desktop.cs +++ /dev/null @@ -1,78 +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.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class ApplicationWithTagHelpersTest_Desktop : - LoggedTest, IClassFixture - { - public ApplicationWithTagHelpersTest_Desktop( - ApplicationWithTagHelpersTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task Precompilation_WorksForViewsThatUseTagHelpersFromProjectReferences() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/ClassLibraryTagHelper", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent($"ApplicationWithTagHelpers.Home.ClassLibraryTagHelper.txt", response); - } - } - - [ConditionalFact] - public async Task Precompilation_WorksForViewsThatUseTagHelpersFromCurrentProject() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/LocalTagHelper", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent($"ApplicationWithTagHelpers.Home.LocalTagHelper.txt", response); - } - } - - public class ApplicationWithTagHelpersTestFixture : DesktopApplicationTestFixture - { - protected override Task CreateDeploymentAsyncCore(ILoggerFactory loggerFactory) - { - CopyDirectory( - new DirectoryInfo(Path.Combine(ApplicationPath, "..", "ClassLibraryTagHelper")), - new DirectoryInfo(Path.Combine(WorkingDirectory, "ClassLibraryTagHelper"))); - - return base.CreateDeploymentAsyncCore(loggerFactory); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/DesktopApplicationTestFixture.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/DesktopApplicationTestFixture.cs deleted file mode 100644 index a95dc59e7f..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/DesktopApplicationTestFixture.cs +++ /dev/null @@ -1,22 +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 Microsoft.AspNetCore.Server.IntegrationTesting; - -namespace FunctionalTests -{ - public class DesktopApplicationTestFixture : ApplicationTestFixture - { - public DesktopApplicationTestFixture() - : this(typeof(TStartup).Assembly.GetName().Name, null) - { - } - - protected DesktopApplicationTestFixture(string applicationName, string applicationPath) - : base(applicationName, applicationPath) - { - } - - protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.Clr, "net461"); - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/PublishWithEmbedViewSourcesTest_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/PublishWithEmbedViewSourcesTest_Desktop.cs deleted file mode 100644 index eea2b45da7..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/PublishWithEmbedViewSourcesTest_Desktop.cs +++ /dev/null @@ -1,65 +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; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class PublishWithEmbedViewSourcesTest_Desktop - : LoggedTest, IClassFixture> - { - public PublishWithEmbedViewSourcesTest_Desktop( - DesktopApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task Precompilation_CanEmbedViewSourcesAsResources() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var logger = loggerFactory.CreateLogger(Fixture.ApplicationName); - var expectedViews = new[] - { - "/Areas/TestArea/Views/Home/Index.cshtml", - "/Views/Home/About.cshtml", - "/Views/Home/Index.cshtml", - }; - var expectedText = "Hello Index!"; - - // Act - 1 - var response1 = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/Index", - logger); - - // Assert - 1 - Assert.Equal(expectedText, response1.Trim()); - - // Act - 2 - var response2 = await deployment.HttpClient.GetStringWithRetryAsync( - "Home/GetPrecompiledResourceNames", - logger); - - // Assert - 2 - var actual = response2.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) - .OrderBy(p => p, StringComparer.OrdinalIgnoreCase); - Assert.Equal(expectedViews, actual); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/RazorPagesAppTest_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/RazorPagesAppTest_Desktop.cs deleted file mode 100644 index bbdf42bdaf..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/RazorPagesAppTest_Desktop.cs +++ /dev/null @@ -1,137 +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.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class RazorPagesAppTest_Desktop : - LoggedTest, IClassFixture> - { - public RazorPagesAppTest_Desktop( - DesktopApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task Precompilation_WorksForIndexPage_UsingFolderName() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "/", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("RazorPages.Index.txt", response); - } - } - - [ConditionalFact] - public async Task Precompilation_WorksForIndexPage_UsingFileName() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "/Index", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("RazorPages.Index.txt", response); - } - } - - [ConditionalFact] - public async Task Precompilation_WorksForPageWithModel() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "/PageWithModel?person=Dan", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("RazorPages.PageWithModel.txt", response); - } - } - - [ConditionalFact] - public async Task Precompilation_WorksForPageWithRoute() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "/PageWithRoute/Dan", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("RazorPages.PageWithRoute.txt", response); - } - } - - [ConditionalFact] - public async Task Precompilation_WorksForPageInNestedFolder() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - "/Nested1/Nested2/PageWithTagHelper", - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("RazorPages.Nested1.Nested2.PageWithTagHelper.txt", response); - } - } - - [ConditionalFact] - public async Task Precompilation_WorksWithPageConventions() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await RetryHelper.RetryRequest( - () => deployment.HttpClient.GetAsync("/Auth/Index"), - loggerFactory.CreateLogger(Fixture.ApplicationName), - retryCount: 5); - - // Assert - Assert.Equal("/Login?ReturnUrl=%2FAuth%2FIndex", response.RequestMessage.RequestUri.PathAndQuery); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/SimpleAppTestWithPlatformx86_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/SimpleAppTestWithPlatformx86_Desktop.cs deleted file mode 100644 index ca47095612..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/SimpleAppTestWithPlatformx86_Desktop.cs +++ /dev/null @@ -1,57 +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.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class SimpleAppTestWithPlatformx86_Desktop : - LoggedTest, IClassFixture> - { - public SimpleAppTestWithPlatformx86_Desktop( - DesktopApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task Precompilation_PublishingForPlatform() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); - } - } - - public class SimpleAppTestWithPlatformx86_DesktopFixture : DesktopApplicationTestFixture - { - protected override DeploymentParameters GetDeploymentParameters() - { - var parameters = base.GetDeploymentParameters(); - parameters.AdditionalPublishParameters = "/p:Platform=x86"; - - return parameters; - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs deleted file mode 100644 index e3fa91caa5..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs +++ /dev/null @@ -1,46 +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.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class SimpleAppTest_Desktop : - LoggedTest, IClassFixture> - { - public SimpleAppTest_Desktop( - DesktopApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task Precompilation_WorksForSimpleApps() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/SimpleAppWithAssemblyRenameTest_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/SimpleAppWithAssemblyRenameTest_Desktop.cs deleted file mode 100644 index bb16ce3dea..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/SimpleAppWithAssemblyRenameTest_Desktop.cs +++ /dev/null @@ -1,55 +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.Threading.Tasks; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class SimpleAppWithAssemblyRenameTest_Desktop : - LoggedTest, IClassFixture - { - public SimpleAppWithAssemblyRenameTest_Desktop( - TestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task Precompilation_WorksForSimpleApps() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("SimpleAppWithAssemblyRenameTest.Home.Index.txt", response); - } - } - - public class TestFixture : DesktopApplicationTestFixture - { - public TestFixture() - : base( - typeof(SimpleAppWithAssemblyRename.Startup).Assembly.GetName().Name, - ApplicationPaths.GetTestAppDirectory(nameof(SimpleAppWithAssemblyRename))) - { - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/StrongNamedAppTest_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/StrongNamedAppTest_Desktop.cs deleted file mode 100644 index 16f63fbe3b..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/StrongNamedAppTest_Desktop.cs +++ /dev/null @@ -1,45 +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.Threading.Tasks; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class StrongNamedAppTest_Desktop : - LoggedTest, IClassFixture> - { - public StrongNamedAppTest_Desktop( - DesktopApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task PrecompiledAssembliesUseSameStrongNameAsApplication() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - - // Assert - TestEmbeddedResource.AssertContent("StrongNamedApp.Home.Index.txt", response); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ViewCompilationOptionsTest_Desktop.cs b/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ViewCompilationOptionsTest_Desktop.cs deleted file mode 100644 index 053b7456a9..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/DesktopTests/ViewCompilationOptionsTest_Desktop.cs +++ /dev/null @@ -1,60 +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.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class ViewCompilationOptions_Desktop_ScenarioRefAssembliesDoNotGetPublished : - LoggedTest, IClassFixture - { - public ViewCompilationOptions_Desktop_ScenarioRefAssembliesDoNotGetPublished( - TestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task PublishingWithOption_AllowsPublishingRefAssemblies() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act & Assert - Assert.True(Directory.Exists(Path.Combine(deployment.ContentRoot, "refs"))); - } - } - - public class TestFixture : DesktopApplicationTestFixture - { - public TestFixture() - { - PublishOnly = true; - } - - protected override DeploymentParameters GetDeploymentParameters() - { - var deploymentParameters = base.GetDeploymentParameters(); - deploymentParameters.PublishEnvironmentVariables.Add( - new KeyValuePair("MvcRazorExcludeRefAssembliesFromPublish", "false")); - - return deploymentParameters; - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/FunctionalTests.csproj b/src/MvcPrecompilation/test/FunctionalTests/FunctionalTests.csproj deleted file mode 100644 index a0c5f23b91..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/FunctionalTests.csproj +++ /dev/null @@ -1,50 +0,0 @@ - - - - $(StandardTestTfms) - - $(DefineConstants);__remove_this_to__GENERATE_BASELINES - $(DefineConstants);GENERATE_BASELINES - false - false - - win7-x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/ApplicationPaths.cs b/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/ApplicationPaths.cs deleted file mode 100644 index d0b044adb9..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/ApplicationPaths.cs +++ /dev/null @@ -1,39 +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; -using System.IO; - -namespace FunctionalTests -{ - public static class ApplicationPaths - { - private const string SolutionName = "RazorViewCompilation.sln"; - - public static string SolutionDirectory { get; } = GetSolutionDirectory(); - - public static string ArtifactPackagesDirectory => Path.Combine(SolutionDirectory, "artifacts", "build"); - - public static string GetTestAppDirectory(string appName) => - Path.Combine(SolutionDirectory, "testapps", appName); - - private static string GetSolutionDirectory() - { - var applicationBasePath = AppContext.BaseDirectory; - - var directoryInfo = new DirectoryInfo(applicationBasePath); - do - { - var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, SolutionName)); - if (solutionFileInfo.Exists) - { - return directoryInfo.FullName; - } - - directoryInfo = directoryInfo.Parent; - } while (directoryInfo.Parent != null); - - throw new InvalidOperationException($"Solution directory could not be found for {applicationBasePath}."); - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs b/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs deleted file mode 100644 index 698a598593..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs +++ /dev/null @@ -1,188 +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; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.AspNetCore.Testing; -using Microsoft.Extensions.Logging; - -namespace FunctionalTests -{ - public abstract class ApplicationTestFixture : IDisposable - { - private const string DotnetCLITelemetryOptOut = "DOTNET_CLI_TELEMETRY_OPTOUT"; - private static readonly string SolutionDirectory; - - private Task _deploymentTask; - private ApplicationDeployer _deployer; - - static ApplicationTestFixture() - { - SolutionDirectory = TestPathUtilities.GetSolutionRootDirectory("RazorViewCompilation"); - if (!SolutionDirectory.EndsWith(Path.DirectorySeparatorChar.ToString())) - { - SolutionDirectory += Path.DirectorySeparatorChar; - } - } - - protected ApplicationTestFixture(string applicationName, string applicationPath) - { - ApplicationName = applicationName; - ApplicationPath = applicationPath ?? ApplicationPaths.GetTestAppDirectory(applicationName); - WorkingDirectory = Path.Combine(Path.GetTempPath(), "PrecompilationTool", Path.GetRandomFileName()); - TestProjectDirectory = Path.Combine(WorkingDirectory, ApplicationName); - } - - public string ApplicationName { get; } - - public string ApplicationPath { get; } - - public string WorkingDirectory { get; } - - public string TestProjectDirectory { get; } - - public bool PublishOnly { get; set; } - - protected abstract DeploymentParameters GetDeploymentParameters(); - - protected DeploymentParameters GetDeploymentParameters(RuntimeFlavor flavor, string targetFramework) - => GetDeploymentParameters(TestProjectDirectory, ApplicationName, flavor, targetFramework); - - private static DeploymentParameters GetDeploymentParameters(string applicationPath, string applicationName, RuntimeFlavor flavor, string targetFramework) - { - // This determines the configuration of the the test project and consequently the configuration the src projects are most likely built in. - var projectConfiguration = -#if DEBUG - "Debug"; -#elif RELEASE - "Release"; -#else -#error Unknown configuration -#endif - - var deploymentParameters = new DeploymentParameters( - applicationPath, - ServerType.Kestrel, - flavor, - RuntimeArchitecture.x64) - { - ApplicationName = applicationName, - ApplicationType = flavor == RuntimeFlavor.Clr ? ApplicationType.Standalone : ApplicationType.Portable, - PublishApplicationBeforeDeployment = true, - Configuration = projectConfiguration, - EnvironmentVariables = - { - new KeyValuePair(DotnetCLITelemetryOptOut, "1"), - new KeyValuePair("SolutionDirectory", SolutionDirectory), - new KeyValuePair("SolutionConfiguration", projectConfiguration), - }, - PublishEnvironmentVariables = - { - new KeyValuePair(DotnetCLITelemetryOptOut, "1"), - new KeyValuePair("SolutionDirectory", SolutionDirectory), - new KeyValuePair("SolutionConfiguration", projectConfiguration), - }, - TargetFramework = targetFramework, - }; - - return deploymentParameters; - } - - public void Dispose() - { - if (_deploymentTask?.Status == TaskStatus.RanToCompletion) - { - _deploymentTask.Result.HttpClient?.Dispose(); - } - - CleanupWorkingDirectory(); - - _deployer?.Dispose(); - } - - public Task CreateDeploymentAsync(ILoggerFactory loggerFactory) - { - if (_deploymentTask == null) - { - _deploymentTask = CreateDeploymentAsyncCore(loggerFactory); - } - - return _deploymentTask; - } - - protected virtual Task CreateDeploymentAsyncCore(ILoggerFactory loggerFactory) - { - CopyDirectory(new DirectoryInfo(ApplicationPath), new DirectoryInfo(TestProjectDirectory)); - - File.Copy(Path.Combine(SolutionDirectory, "global.json"), Path.Combine(TestProjectDirectory, "global.json")); - File.Copy(Path.Combine(ApplicationPath, "..", "Directory.Build.props"), Path.Combine(TestProjectDirectory, "Directory.Build.props")); - File.Copy(Path.Combine(ApplicationPath, "..", "Directory.Build.targets"), Path.Combine(TestProjectDirectory, "Directory.Build.targets")); - - var deploymentParameters = GetDeploymentParameters(); - if (PublishOnly) - { - _deployer = new PublishOnlyDeployer(deploymentParameters, loggerFactory); - } - else - { - _deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory); - } - - return _deployer.DeployAsync(); - } - - public void CopyDirectory(DirectoryInfo source, DirectoryInfo destination, bool recursive = true) - { - // Recurse into subdirectories - foreach (var directory in source.EnumerateDirectories()) - { - if (directory.Name == "bin") - { - continue; - } - - var created = destination.CreateSubdirectory(directory.Name); - - // We only want to copy the restore artifacts from obj directory while ignoring in any configuration specific directories - CopyDirectory(directory, created, recursive: directory.Name != "obj"); - } - - foreach (var file in source.EnumerateFiles()) - { - file.CopyTo(Path.Combine(destination.FullName, file.Name)); - } - } - - private void CleanupWorkingDirectory() - { - var tries = 5; - var sleep = TimeSpan.FromSeconds(3); - - for (var i = 0; i < tries; i++) - { - try - { - if (Directory.Exists(WorkingDirectory)) - { - Directory.Delete(WorkingDirectory, recursive: true); - } - return; - } - catch when (i < tries - 1) - { - Console.WriteLine($"Failed to delete directory {TestProjectDirectory}, trying again."); - Thread.Sleep(sleep); - } - catch - { - // Do nothing - } - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/HttpClientExtensions.cs b/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/HttpClientExtensions.cs deleted file mode 100644 index 0c9561cde3..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/HttpClientExtensions.cs +++ /dev/null @@ -1,38 +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; -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.Extensions.Logging; -using Xunit; - -namespace FunctionalTests -{ - public static class HttpClientExtensions - { - public static Task GetStringWithRetryAsync( - this HttpClient httpClient, - ILogger logger) - { - return GetStringWithRetryAsync(httpClient, httpClient.BaseAddress.AbsoluteUri, logger); - } - - public static async Task GetStringWithRetryAsync( - this HttpClient httpClient, - string url, - ILogger logger) - { - var response = await RetryHelper.RetryRequest(() => httpClient.GetAsync(url), logger, retryCount: 5); - var content = await response.Content.ReadAsStringAsync(); - - Assert.True(response.IsSuccessStatusCode, - $"Failed to GET content from {url}. Status code {response.StatusCode}." + - Environment.NewLine + - content); - - return content; - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/PublishOnlyDeployer.cs b/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/PublishOnlyDeployer.cs deleted file mode 100644 index 82a84209eb..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/PublishOnlyDeployer.cs +++ /dev/null @@ -1,47 +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; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting.Common; -using Microsoft.AspNetCore.Testing; -using Microsoft.Extensions.Logging; - -namespace Microsoft.AspNetCore.Server.IntegrationTesting -{ - public class PublishOnlyDeployer : SelfHostDeployer - { - public PublishOnlyDeployer(DeploymentParameters deploymentParameters, ILoggerFactory loggerFactory) - : base(deploymentParameters, loggerFactory) - { - } - - public override Task DeployAsync() - { - using (Logger.BeginScope("SelfHost.Deploy")) - { - // Start timer - StartTimer(); - - if (DeploymentParameters.PublishApplicationBeforeDeployment) - { - DotnetPublish(); - } - - var result = new DeploymentResult( - LoggerFactory, - DeploymentParameters, - applicationBaseUri: "http://localhost", - contentRoot: DeploymentParameters.PublishApplicationBeforeDeployment ? DeploymentParameters.PublishedApplicationRootPath : DeploymentParameters.ApplicationPath, - hostShutdownToken: default(CancellationToken)); - - return Task.FromResult(result); - } - } - } -} diff --git a/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/TestEmbeddedResource.cs b/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/TestEmbeddedResource.cs deleted file mode 100644 index c98cd4c348..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Infrastructure/TestEmbeddedResource.cs +++ /dev/null @@ -1,58 +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.IO; -using System.Reflection; -using Xunit; - -namespace FunctionalTests -{ - public static class TestEmbeddedResource - { - private static readonly object _writeLock = new object(); - private static readonly string ProjectName = typeof(TestEmbeddedResource).GetTypeInfo().Assembly.GetName().Name; - - public static void AssertContent(string resourceFile, string actual) - { - var expected = GetResourceContent(resourceFile); -#if GENERATE_BASELINES - // Normalize line endings to '\r\n' for comparison. This removes Environment.NewLine from the equation. Not - // worth updating files just because we generate baselines on a different system. - var normalizedContent = actual.Replace("\r", "").Replace("\n", "\r\n"); - - if (!string.Equals(expected, normalizedContent, System.StringComparison.Ordinal)) - { - var solutionRoot = ApplicationPaths.SolutionDirectory; - var projectName = typeof(TestEmbeddedResource).GetTypeInfo().Assembly.GetName().Name; - var fullPath = Path.Combine(solutionRoot, "test", ProjectName, "Resources", resourceFile); - lock (_writeLock) - { - // Write content to the file, creating it if necessary. - File.WriteAllText(fullPath, actual); - } - } -#else - Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); -#endif - } - - private static string GetResourceContent(string resourceFile) - { - resourceFile = $"{ProjectName}.Resources.{resourceFile}"; - var assembly = typeof(TestEmbeddedResource).GetTypeInfo().Assembly; - var resourceStream = assembly.GetManifestResourceStream(resourceFile); - if (resourceStream == null) - { - return null; - } - - using (var streamReader = new StreamReader(resourceStream)) - { - // Normalize line endings to '\r\n' (CRLF). This removes core.autocrlf, core.eol, core.safecrlf, and - // .gitattributes from the equation and treats "\r\n" and "\n" as equivalent. Does not handle - // some line endings like "\r" but otherwise ensures checksums and line mappings are consistent. - return streamReader.ReadToEnd().Replace("\r", "").Replace("\n", "\r\n"); - } - } - } -} \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Properties/AssemblyInfo.cs b/src/MvcPrecompilation/test/FunctionalTests/Properties/AssemblyInfo.cs deleted file mode 100644 index b1fa884228..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using Xunit; - -[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationConsumingPrecompiledViews.Manage.Home.Index.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationConsumingPrecompiledViews.Manage.Home.Index.txt deleted file mode 100644 index e4baad155e..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationConsumingPrecompiledViews.Manage.Home.Index.txt +++ /dev/null @@ -1,13 +0,0 @@ - - - - ClassLibraryWithPrecompiledViews.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - -

Admin home page

- - - - Test section - - - diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.About.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.About.txt deleted file mode 100644 index c3b073162c..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.About.txt +++ /dev/null @@ -1,8 +0,0 @@ - - - - -ApplicationUsingRelativePaths.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -Hello from Index! - - \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.Index.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.Index.txt deleted file mode 100644 index c3b073162c..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationUsingRelativePaths.Home.Index.txt +++ /dev/null @@ -1,8 +0,0 @@ - - - - -ApplicationUsingRelativePaths.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -Hello from Index! - - \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.Index.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.Index.txt deleted file mode 100644 index 6ed3f16836..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.Index.txt +++ /dev/null @@ -1,2 +0,0 @@ -ApplicationWithConfigureMvc.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -
Hello world! \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.ViewWithPreprocessor.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.ViewWithPreprocessor.txt deleted file mode 100644 index 8d0df2adff..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithConfigureMvc.Home.ViewWithPreprocessor.txt +++ /dev/null @@ -1 +0,0 @@ -Hello from Test123 \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithRazorSdkPrecompilationUsed.Home.Index.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithRazorSdkPrecompilationUsed.Home.Index.txt deleted file mode 100644 index ed399bf490..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithRazorSdkPrecompilationUsed.Home.Index.txt +++ /dev/null @@ -1,8 +0,0 @@ - - - - -ApplicationWithRazorSdkPrecompilationUsed.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -Hello from Index! - - \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithRazorSdkUsed.Home.Index.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithRazorSdkUsed.Home.Index.txt deleted file mode 100644 index ed93ca56a8..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithRazorSdkUsed.Home.Index.txt +++ /dev/null @@ -1,8 +0,0 @@ - - - - -ApplicationWithRazorSdkUsed.Views, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -Hello from Index! - - \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithTagHelpers.Home.ClassLibraryTagHelper.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithTagHelpers.Home.ClassLibraryTagHelper.txt deleted file mode 100644 index f3a28a4d23..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithTagHelpers.Home.ClassLibraryTagHelper.txt +++ /dev/null @@ -1,25 +0,0 @@ - - - - - ApplicationWithTagHelpers - - - - -
- -ApplicationWithTagHelpers.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -
To boldy tag that no one has ever tagged before...
- - - - -
-
-

© 2016 - ApplicationWithTagHelpers

-
-
- - ApplicationWithTagHelpers.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithTagHelpers.Home.LocalTagHelper.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithTagHelpers.Home.LocalTagHelper.txt deleted file mode 100644 index 43afc098bd..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/ApplicationWithTagHelpers.Home.LocalTagHelper.txt +++ /dev/null @@ -1,25 +0,0 @@ - - - - - ApplicationWithTagHelpers - - - - -
- -ApplicationWithTagHelpers.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -TestTagHelper content. - - - - -
-
-

© 2016 - ApplicationWithTagHelpers

-
-
- - ApplicationWithTagHelpers.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.Index.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.Index.txt deleted file mode 100644 index ff3f1d2458..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.Index.txt +++ /dev/null @@ -1,2 +0,0 @@ - -Hello world! \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.Nested1.Nested2.PageWithTagHelper.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.Nested1.Nested2.PageWithTagHelper.txt deleted file mode 100644 index 9cf6533fae..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.Nested1.Nested2.PageWithTagHelper.txt +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.PageWithModel.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.PageWithModel.txt deleted file mode 100644 index 1cdbdae92e..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.PageWithModel.txt +++ /dev/null @@ -1,2 +0,0 @@ - -Greetings Dan! \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.PageWithRoute.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.PageWithRoute.txt deleted file mode 100644 index 1cdbdae92e..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/RazorPages.PageWithRoute.txt +++ /dev/null @@ -1,2 +0,0 @@ - -Greetings Dan! \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/SimpleAppTest.Home.Index.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/SimpleAppTest.Home.Index.txt deleted file mode 100644 index afba35a9ea..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/SimpleAppTest.Home.Index.txt +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - Home Page - SimpleApp - - - - - - - - - - -
- -SimpleApp.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - - -
-
-

© 2016 - SimpleApp

-
-
- - - - - - - - - - - - SimpleApp.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/SimpleAppWithAssemblyRenameTest.Home.Index.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/SimpleAppWithAssemblyRenameTest.Home.Index.txt deleted file mode 100644 index 29d346230b..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/SimpleAppWithAssemblyRenameTest.Home.Index.txt +++ /dev/null @@ -1,2 +0,0 @@ - -NewAssemblyName.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/src/MvcPrecompilation/test/FunctionalTests/Resources/StrongNamedApp.Home.Index.txt b/src/MvcPrecompilation/test/FunctionalTests/Resources/StrongNamedApp.Home.Index.txt deleted file mode 100644 index edfb07d5d7..0000000000 --- a/src/MvcPrecompilation/test/FunctionalTests/Resources/StrongNamedApp.Home.Index.txt +++ /dev/null @@ -1 +0,0 @@ -Hello from view in StrongNamedApp.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 diff --git a/src/MvcPrecompilation/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj b/src/MvcPrecompilation/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj deleted file mode 100644 index 06337dac6a..0000000000 --- a/src/MvcPrecompilation/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - $(StandardTestTfms) - - - - - - - diff --git a/src/MvcPrecompilation/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/PrecompileRunCommandTest.cs b/src/MvcPrecompilation/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/PrecompileRunCommandTest.cs deleted file mode 100644 index 2216073045..0000000000 --- a/src/MvcPrecompilation/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/PrecompileRunCommandTest.cs +++ /dev/null @@ -1,220 +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; -using System.IO; -using System.Linq; -using System.Reflection; -using Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.Emit; -using Xunit; - -namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation -{ - public class PrecompileRunCommandTest - { - [Fact] - public void RunPrintsHelp_WhenHelpOptionIsSpecified() - { - // Arrange - var expected = -$@"Microsoft Razor Precompilation Utility {GetToolVersion()} - -Usage: razor-precompile [arguments] [options] - -Arguments: - project The path to the project file. - -Options: - -?|-h|--help Show help information - --output-path Path to the emit the precompiled assembly to. - --application-name Name of the application to produce precompiled assembly for. - --configure-compilation-type Type with Configure method - --content-root The application's content root. - --embed-view-sources Embed view sources as resources in the generated assembly. - --key-file Strong name key path. - --delay-sign Determines if the precompiled view assembly is to be delay signed. - --public-sign Determines if the precompiled view assembly is to be public signed. - --file Razor files to compile."; - - var args = new[] - { - "--help" - }; - - // Act - var result = Execute(args); - - // Assert - Assert.Equal(0, result.ExitCode); - Assert.Equal(expected, result.Out.Trim(), ignoreLineEndingDifferences: true); - Assert.Empty(result.Error); - } - - [Fact] - public void Run_PrintsHelpWhenInvalidOptionsAreSpecified() - { - // Arrange - var expectedOut = @"Specify --help for a list of available options and commands."; - var expectedError = @"Unrecognized option '--bad-option'"; - var args = new[] - { - "--bad-option" - }; - - // Act - var result = Execute(args); - - // Assert - Assert.Equal(1, result.ExitCode); - Assert.Equal(expectedOut, result.Out.Trim()); - Assert.Equal( - expectedError, - result.Error.Split(new[] { Environment.NewLine }, StringSplitOptions.None).First()); - } - - [Fact] - public void Run_PrintsErrorWhenArgumentIsMissing() - { - // Arrange - var expectedError = @"Project path not specified."; - var args = new string[0]; - - // Act - var result = Execute(args); - - // Assert - Assert.Equal(1, result.ExitCode); - Assert.Empty(result.Out); - Assert.Equal(expectedError, result.Error.Trim()); - } - - [Fact] - public void Run_PrintsErrorWhenOutputPathOptionIsMissing() - { - // Arrange - var expectedError = @"Option --output-path does not specify a value."; - var args = new[] - { - Directory.GetCurrentDirectory(), - }; - - // Act - var result = Execute(args); - - // Assert - Assert.Equal(1, result.ExitCode); - Assert.Empty(result.Out); - Assert.Equal(expectedError, result.Error.Trim()); - } - - [Fact] - public void Run_PrintsErrorWhenApplicationNameOptionIsMissing() - { - // Arrange - var expectedError = @"Option --application-name does not specify a value."; - var args = new[] - { - Directory.GetCurrentDirectory(), - "--output-path", - Directory.GetCurrentDirectory(), - }; - - // Act - var result = Execute(args); - - // Assert - Assert.Equal(1, result.ExitCode); - Assert.Empty(result.Out); - Assert.Equal(expectedError, result.Error.Trim()); - } - - [Fact] - public void Run_PrintsErrorWhenContentRootOptionIsMissing() - { - // Arrange - var expectedError = @"Option --content-root does not specify a value."; - var args = new[] - { - Directory.GetCurrentDirectory(), - "--output-path", - Directory.GetCurrentDirectory(), - "--application-name", - "TestApplicationName", - }; - - // Act - var result = Execute(args); - - // Assert - Assert.Equal(1, result.ExitCode); - Assert.Empty(result.Out); - Assert.Equal(expectedError, result.Error.Trim()); - } - - [Fact] - public void EmitAssembly_DoesNotWriteAssembliesToDisk_IfCompilationFails() - { - // Arrange - var assemblyDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - var assemblyPath = Path.Combine(assemblyDirectory, "out.dll"); - var precompileRunCommand = new PrecompileRunCommand(); - var syntaxTree = CSharpSyntaxTree.ParseText("using Microsoft.DoestNotExist"); - var compilation = CSharpCompilation.Create("Test.dll", new[] { syntaxTree }); - - // Act - var emitResult = precompileRunCommand.EmitAssembly( - compilation, - new EmitOptions(), - assemblyPath, - new ResourceDescription[0]); - - // Assert - Assert.False(emitResult.Success); - Assert.False(Directory.Exists(assemblyDirectory)); - Assert.False(File.Exists(assemblyPath)); - } - - private static string GetToolVersion() - { - return typeof(Program) - .GetTypeInfo() - .Assembly - .GetCustomAttribute() - .InformationalVersion; - } - - private class ExecuteResult - { - public string Out { get; set; } - - public string Error { get; set; } - - public int ExitCode { get; set; } - } - - private ExecuteResult Execute(string[] args) - { - using (var outputWriter = new StringWriter()) - using (var errorWriter = new StringWriter()) - { - var app = new PrecompilationApplication(typeof(Program)) - { - Out = outputWriter, - Error = errorWriter, - }; - new PrecompileRunCommand().Configure(app); - var exitCode = app.Execute(args); - - return new ExecuteResult - { - ExitCode = exitCode, - Out = outputWriter.ToString(), - Error = errorWriter.ToString(), - }; - } - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj b/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj deleted file mode 100644 index 26ecdd3795..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(StandardTestAppTfms) - $(DefineConstants);TEST123 - - true - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Controllers/HomeController.cs b/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Controllers/HomeController.cs deleted file mode 100644 index 0b6e29e940..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Controllers/HomeController.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace ApplicationWithConfigureStartup.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() => View(); - - public IActionResult ViewWithPreprocessor() => View(); - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Program.cs b/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Program.cs deleted file mode 100644 index 2adf60f59b..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace ApplicationWithConfigureStartup -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/RazorRewriter.cs b/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/RazorRewriter.cs deleted file mode 100644 index 4c0e42db4f..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/RazorRewriter.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; - -namespace ApplicationWithConfigureStartup -{ - public class RazorRewriter : CSharpSyntaxRewriter - { - public override SyntaxNode VisitLiteralExpression(LiteralExpressionSyntax node) - { - if (node.Token.IsKind(SyntaxKind.StringLiteralToken)) - { - return node.WithToken(SyntaxFactory.Literal( - node.Token.ValueText.Replace(Environment.NewLine, Environment.NewLine + "
"))); - } - - return node; - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Startup.cs b/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Startup.cs deleted file mode 100644 index bad4439448..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Startup.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace ApplicationWithConfigureStartup -{ - public class Startup : IDesignTimeMvcBuilderConfiguration - { - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - var builder = services.AddMvc(); - ConfigureMvc(builder); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - - public void ConfigureMvc(IMvcBuilder builder) - { - builder.AddRazorOptions(options => - { -#pragma warning disable CS0618 // Type or member is obsolete - var callback = options.CompilationCallback; - options.CompilationCallback = context => -#pragma warning restore CS0618 // Type or member is obsolete - { - callback(context); - foreach (var tree in context.Compilation.SyntaxTrees) - { - var rewrittenRoot = new RazorRewriter().Visit(tree.GetRoot()); - var rewrittenTree = tree.WithRootAndOptions(rewrittenRoot, tree.Options); - context.Compilation = context.Compilation.ReplaceSyntaxTree(tree, rewrittenTree); - } - }; - }); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Views/Home/Index.cshtml deleted file mode 100644 index 0303f3279e..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Views/Home/Index.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@GetType().Assembly.FullName -Hello world! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Views/Home/ViewWithPreprocessor.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Views/Home/ViewWithPreprocessor.cshtml deleted file mode 100644 index 6330cc26f5..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithConfigureMvc/Views/Home/ViewWithPreprocessor.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - var message = "Hello world message"; -#if TEST123 - message = "Hello from Test123"; -#endif -} -@message \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj b/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj deleted file mode 100644 index c9b9f513ff..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - $(StandardTestAppTfms) - - true - true - - - - - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Controllers/HomeController.cs b/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Controllers/HomeController.cs deleted file mode 100644 index 90009a185a..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Controllers/HomeController.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ApplicationParts; -using Microsoft.AspNetCore.Mvc.Razor.Compilation; - -namespace ApplicationWithCustomInputFiles.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public string GetPrecompiledResourceNames([FromServices] ApplicationPartManager applicationManager) - { - var feature = new ViewsFeature(); - applicationManager.PopulateFeature(feature); - return string.Join(Environment.NewLine, feature.ViewDescriptors.Select(v => v.RelativePath)); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Program.cs b/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Program.cs deleted file mode 100644 index 4762a2c769..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace ApplicationWithCustomInputFiles -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Startup.cs b/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Startup.cs deleted file mode 100644 index d42b8dfad9..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Startup.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace ApplicationWithCustomInputFiles -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddMvc(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Views/Home/About.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Views/Home/About.cshtml deleted file mode 100644 index 7d1b75a54e..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Views/Home/About.cshtml +++ /dev/null @@ -1 +0,0 @@ -Hello from About \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Views/Home/Index.cshtml deleted file mode 100644 index a2ab94af53..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Views/Home/Index.cshtml +++ /dev/null @@ -1 +0,0 @@ -Hello Index! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Views/Home/NotIncluded.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Views/Home/NotIncluded.cshtml deleted file mode 100644 index 540a51ba00..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithCustomInputFiles/Views/Home/NotIncluded.cshtml +++ /dev/null @@ -1 +0,0 @@ -This file is not included in compilation. \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj b/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj deleted file mode 100644 index 91b6481522..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - $(StandardTestAppTfms) - - true - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Program.cs b/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Program.cs deleted file mode 100644 index 0ceb49039f..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace ApplicationWithParseErrors -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Startup.cs b/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Startup.cs deleted file mode 100644 index b573e39a8c..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Startup.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace ApplicationWithParseErrors -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvcWithDefaultRoute(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Views/Home/About.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Views/Home/About.cshtml deleted file mode 100644 index ddda42f574..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Views/Home/About.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using ApplicationWithParseErrors -@ diff --git a/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Views/Home/Index.cshtml deleted file mode 100644 index 94ef1191a9..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithParseErrors/Views/Home/Index.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@{ - -} - \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/ApplicationWithRazorSdkNeitherUsed.csproj b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/ApplicationWithRazorSdkNeitherUsed.csproj deleted file mode 100644 index 97c4916e21..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/ApplicationWithRazorSdkNeitherUsed.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - $(StandardTestAppTfms) - - - false - - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Controllers/HomeController.cs b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Controllers/HomeController.cs deleted file mode 100644 index e2d7c9f420..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Controllers/HomeController.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace ApplicationWithRazorSdkNeitherUsed.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View("Views/Home/Index.cshtml"); - } - - public IActionResult About() - { - ViewData["Message"] = "Your application description page."; - - return View(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Program.cs b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Program.cs deleted file mode 100644 index faefdc68f5..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace ApplicationWithRazorSdkNeitherUsed -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Startup.cs b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Startup.cs deleted file mode 100644 index 4b06309f6d..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Startup.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace ApplicationWithRazorSdkNeitherUsed -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddMvc(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvcWithDefaultRoute(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/Home/About.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/Home/About.cshtml deleted file mode 100644 index bbc0672575..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/Home/About.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - Layout = "../Shared/_Layout.cshtml"; - ViewData["Title"] = "About"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -

Use this area to provide additional information.

diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/Home/Index.cshtml deleted file mode 100644 index d29ab9cb6e..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/Home/Index.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -@GetType().AssemblyQualifiedName -Hello from Index! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/Shared/_Layout.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/Shared/_Layout.cshtml deleted file mode 100644 index 4c909415a4..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,6 +0,0 @@ - - - - @RenderBody() - - \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/_ViewImports.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/_ViewImports.cshtml deleted file mode 100644 index d320fb1cc8..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using ApplicationWithRazorSdkNeitherUsed -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/_ViewStart.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/_ViewStart.cshtml deleted file mode 100644 index 1b4f3a0748..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkNeitherUsed/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "Shared/_Layout.cshtml"; -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/ApplicationWithRazorSdkPrecompilationUsed.csproj b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/ApplicationWithRazorSdkPrecompilationUsed.csproj deleted file mode 100644 index 653d7c7a94..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/ApplicationWithRazorSdkPrecompilationUsed.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - $(StandardTestAppTfms) - - - true - - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Controllers/HomeController.cs b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Controllers/HomeController.cs deleted file mode 100644 index 3a08839984..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Controllers/HomeController.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace ApplicationWithRazorSdkPrecompilationUsed.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View("Views/Home/Index.cshtml"); - } - - public IActionResult About() - { - ViewData["Message"] = "Your application description page."; - - return View(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Program.cs b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Program.cs deleted file mode 100644 index 96af521013..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace ApplicationWithRazorSdkPrecompilationUsed -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Startup.cs b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Startup.cs deleted file mode 100644 index 16c835e52d..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Startup.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace ApplicationWithRazorSdkPrecompilationUsed -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddMvc(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvcWithDefaultRoute(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/Home/About.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/Home/About.cshtml deleted file mode 100644 index bbc0672575..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/Home/About.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - Layout = "../Shared/_Layout.cshtml"; - ViewData["Title"] = "About"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -

Use this area to provide additional information.

diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/Home/Index.cshtml deleted file mode 100644 index b2bf7cf3d1..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/Home/Index.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -@GetType().Assembly.FullName -Hello from Index! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/Shared/_Layout.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/Shared/_Layout.cshtml deleted file mode 100644 index 4c909415a4..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,6 +0,0 @@ - - - - @RenderBody() - - \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/_ViewImports.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/_ViewImports.cshtml deleted file mode 100644 index cde83e7865..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using ApplicationWithRazorSdkPrecompilationUsed -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/_ViewStart.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/_ViewStart.cshtml deleted file mode 100644 index 1b4f3a0748..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkPrecompilationUsed/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "Shared/_Layout.cshtml"; -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/ApplicationWithRazorSdkUsed.csproj b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/ApplicationWithRazorSdkUsed.csproj deleted file mode 100644 index abe44b964e..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/ApplicationWithRazorSdkUsed.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - $(StandardTestAppTfms) - - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Controllers/HomeController.cs b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Controllers/HomeController.cs deleted file mode 100644 index 71fe569fa3..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Controllers/HomeController.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace ApplicationWithRazorSdkUsed.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View("Views/Home/Index.cshtml"); - } - - public IActionResult About() - { - ViewData["Message"] = "Your application description page."; - - return View(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Program.cs b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Program.cs deleted file mode 100644 index c0db031636..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace ApplicationWithRazorSdkUsed -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Startup.cs b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Startup.cs deleted file mode 100644 index 8c6e88ed12..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Startup.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace ApplicationWithRazorSdkUsed -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddMvc(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvcWithDefaultRoute(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/Home/About.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/Home/About.cshtml deleted file mode 100644 index bbc0672575..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/Home/About.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - Layout = "../Shared/_Layout.cshtml"; - ViewData["Title"] = "About"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -

Use this area to provide additional information.

diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/Home/Index.cshtml deleted file mode 100644 index b2bf7cf3d1..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/Home/Index.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -@GetType().Assembly.FullName -Hello from Index! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/Shared/_Layout.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/Shared/_Layout.cshtml deleted file mode 100644 index 4c909415a4..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,6 +0,0 @@ - - - - @RenderBody() - - \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/_ViewImports.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/_ViewImports.cshtml deleted file mode 100644 index c384203c5b..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using ApplicationWithRazorSdkUsed -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/_ViewStart.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/_ViewStart.cshtml deleted file mode 100644 index 1b4f3a0748..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithRazorSdkUsed/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "Shared/_Layout.cshtml"; -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj deleted file mode 100644 index 20205954fd..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - $(StandardTestAppTfms) - - true - - - - - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Components/CopyrightViewComponent.cs b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Components/CopyrightViewComponent.cs deleted file mode 100644 index a52e8e7436..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Components/CopyrightViewComponent.cs +++ /dev/null @@ -1,22 +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 Microsoft.AspNetCore.Mvc; - -namespace ApplicationWithTagHelpers -{ - public class CopyrightViewComponent : ViewComponent - { - public IViewComponentResult Invoke(string website, int year) - { - var dict = new Dictionary - { - ["website"] = website, - ["year"] = year - }; - - return View(dict); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Controllers/HomeController.cs b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Controllers/HomeController.cs deleted file mode 100644 index de245b1916..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Controllers/HomeController.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace ApplicationWithTagHelpers.Controllers -{ - public class HomeController : Controller - { - public IActionResult ClassLibraryTagHelper() => View(); - - public IActionResult LocalTagHelper() => View(); - - public IActionResult About() => Content("About content"); - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Program.cs b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Program.cs deleted file mode 100644 index ea75f8ccab..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace ApplicationWithTagHelpers -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Startup.cs b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Startup.cs deleted file mode 100644 index 00a0fb6df9..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Startup.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace ApplicationWithTagHelpers -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddMvc(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/TagHelpers/TestTagHelper.cs b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/TagHelpers/TestTagHelper.cs deleted file mode 100644 index c26d848552..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/TagHelpers/TestTagHelper.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.AspNetCore.Mvc.Routing; -using Microsoft.AspNetCore.Mvc.ViewFeatures; -using Microsoft.AspNetCore.Razor.TagHelpers; - -namespace ApplicationWithTagHelpers.TagHelpers -{ - public class TestTagHelper : TagHelper - { - public TestTagHelper(IUrlHelperFactory urlHelperFactory) - { - UrlHelperFactory = urlHelperFactory; - } - - [HtmlAttributeNotBound] - public IUrlHelperFactory UrlHelperFactory { get; } - - [ViewContext] - [HtmlAttributeNotBound] - public ViewContext ViewContext { get; set; } - - public string Controller { get; set; } - - public string Action { get; set; } - - public override void Process(TagHelperContext context, TagHelperOutput output) - { - var urlHelper = UrlHelperFactory.GetUrlHelper(ViewContext); - output.Attributes.SetAttribute("href", urlHelper.Action(new UrlActionContext - { - Controller = Controller, - Action = Action - })); - - output.PreContent.SetContent($"{nameof(TestTagHelper)} content."); - } - } -} diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Home/ClassLibraryTagHelper.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Home/ClassLibraryTagHelper.cshtml deleted file mode 100644 index bd523d4ea5..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Home/ClassLibraryTagHelper.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@addTagHelper *, ClassLibraryTagHelper - -@GetType().Assembly.FullName -
To boldy tag that no one has ever tagged before...
- - - diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Home/LocalTagHelper.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Home/LocalTagHelper.cshtml deleted file mode 100644 index 930ce6dd1f..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Home/LocalTagHelper.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@addTagHelper *, ApplicationWithTagHelpers - -@GetType().Assembly.FullName - - - - diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Shared/Components/Copyright/Default.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Shared/Components/Copyright/Default.cshtml deleted file mode 100644 index 25ef152a39..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Shared/Components/Copyright/Default.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@model Dictionary -© @Model["year"] - @Model["website"] \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Shared/_Layout.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Shared/_Layout.cshtml deleted file mode 100644 index 7ffe8fc4fc..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,21 +0,0 @@ -@addTagHelper *, ApplicationWithTagHelpers - - - - @ViewData["Title"] - ApplicationWithTagHelpers - - - -
- @RenderBody() -
-
-

-
-
- @RenderSection("scripts", required: false) - @GetType().Assembly.FullName - - diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/_ViewImports.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/_ViewImports.cshtml deleted file mode 100644 index da4a9da3f1..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using ApplicationWithTagHelpers -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/_ViewStart.cshtml b/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/_ViewStart.cshtml deleted file mode 100644 index a5f10045db..0000000000 --- a/src/MvcPrecompilation/testapps/ApplicationWithTagHelpers/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/src/MvcPrecompilation/testapps/ClassLibraryTagHelper/BoldTagHelper.cs b/src/MvcPrecompilation/testapps/ClassLibraryTagHelper/BoldTagHelper.cs deleted file mode 100644 index 1f090f1af1..0000000000 --- a/src/MvcPrecompilation/testapps/ClassLibraryTagHelper/BoldTagHelper.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.AspNetCore.Razor.TagHelpers; - -namespace ClassLibraryTagHelpers -{ - [HtmlTargetElement(Attributes = "bold")] - public class BoldTagHelper : TagHelper - { - public override void Process(TagHelperContext context, TagHelperOutput output) - { - output.Attributes.RemoveAll("bold"); - output.PreContent.AppendHtml(""); - output.PostContent.AppendHtml(""); - } - } -} \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj b/src/MvcPrecompilation/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj deleted file mode 100644 index 309df3008e..0000000000 --- a/src/MvcPrecompilation/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/MvcPrecompilation/testapps/Directory.Build.props b/src/MvcPrecompilation/testapps/Directory.Build.props deleted file mode 100644 index c8b985bfca..0000000000 --- a/src/MvcPrecompilation/testapps/Directory.Build.props +++ /dev/null @@ -1,23 +0,0 @@ - - - $(MSBuildThisFileDirectory)..\ - - - - - - netcoreapp2.2 - $(DeveloperBuildTestAppTfms) - netcoreapp2.2;netcoreapp2.0 - $(StandardTestAppTfms);net461 - - - win7-x64 - - - - - 1.0.0 - false - - diff --git a/src/MvcPrecompilation/testapps/Directory.Build.targets b/src/MvcPrecompilation/testapps/Directory.Build.targets deleted file mode 100644 index 03b1ec5b64..0000000000 --- a/src/MvcPrecompilation/testapps/Directory.Build.targets +++ /dev/null @@ -1,13 +0,0 @@ - - - - - $(MvcRazorCompileOnPublish) - $(Configuration) - <_MvcViewCompilationTasksPath>$(SolutionDirectory)src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\bin\$(SolutionConfiguration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll - <_MvcViewCompilationBinariesDir>$(SolutionDirectory)src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\bin\$(SolutionConfiguration)\ - - - - diff --git a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Areas/TestArea/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Areas/TestArea/Views/Home/Index.cshtml deleted file mode 100644 index a2ab94af53..0000000000 --- a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Areas/TestArea/Views/Home/Index.cshtml +++ /dev/null @@ -1 +0,0 @@ -Hello Index! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Controllers/HomeController.cs b/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Controllers/HomeController.cs deleted file mode 100644 index b97b40fd4c..0000000000 --- a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Controllers/HomeController.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.IO; -using System.Reflection; -using Microsoft.AspNetCore.Mvc; - -namespace PublishWithEmbedViewSources.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public string GetPrecompiledResourceNames() - { - var precompiledAssemblyPath = Path.Combine( - Path.GetDirectoryName(GetType().Assembly.Location), - "PublishWithEmbedViewSources.PrecompiledViews.dll"); - var precompiledAssembly = Assembly.LoadFile(precompiledAssemblyPath); - return string.Join( - Environment.NewLine, - precompiledAssembly.GetManifestResourceNames()); - } - } -} diff --git a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Program.cs b/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Program.cs deleted file mode 100644 index 66e30e6cfe..0000000000 --- a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace PublishWithEmbedViewSources -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj b/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj deleted file mode 100644 index ce7ce79715..0000000000 --- a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(StandardTestAppTfms) - - true - true - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Startup.cs b/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Startup.cs deleted file mode 100644 index c1e951b594..0000000000 --- a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Startup.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace PublishWithEmbedViewSources -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddMvc(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - } -} diff --git a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Views/Home/About.cshtml b/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Views/Home/About.cshtml deleted file mode 100644 index b35b6196f4..0000000000 --- a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Views/Home/About.cshtml +++ /dev/null @@ -1 +0,0 @@ -Hello About! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Views/Home/Index.cshtml deleted file mode 100644 index a2ab94af53..0000000000 --- a/src/MvcPrecompilation/testapps/PublishWithEmbedViewSources/Views/Home/Index.cshtml +++ /dev/null @@ -1 +0,0 @@ -Hello Index! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Auth/Index.cshtml b/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Auth/Index.cshtml deleted file mode 100644 index 3ec4fdbc18..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Auth/Index.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@page -Can't see me diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Index.cshtml b/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Index.cshtml deleted file mode 100644 index 0ac52dc2e9..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Index.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@page - -Hello world! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Login.cshtml b/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Login.cshtml deleted file mode 100644 index 0ac52dc2e9..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Login.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@page - -Hello world! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/MyPageModel.cs b/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/MyPageModel.cs deleted file mode 100644 index 4d8bf5e6b6..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/MyPageModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; - -namespace RazorPagesApp -{ - public class MyPageModel : PageModel - { - public string Name { get; private set; } - - public IActionResult OnGet(string person) - { - Name = person; - return Page(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Nested1/Nested2/PageWithTagHelper.cshtml b/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Nested1/Nested2/PageWithTagHelper.cshtml deleted file mode 100644 index d26fb586b2..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Nested1/Nested2/PageWithTagHelper.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@page - \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Nested1/_ViewImports.cshtml b/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Nested1/_ViewImports.cshtml deleted file mode 100644 index 9018c7897f..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/Nested1/_ViewImports.cshtml +++ /dev/null @@ -1 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/PageWithModel.cshtml b/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/PageWithModel.cshtml deleted file mode 100644 index 51286a72bd..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/PageWithModel.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@page -@model MyPageModel - -Greetings @Model.Name! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/PageWithRoute.cshtml b/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/PageWithRoute.cshtml deleted file mode 100644 index 75f483b8bf..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/PageWithRoute.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@page "{person}" -@model MyPageModel - -Greetings @Model.Name! \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/_PageStart.cshtml b/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/_PageStart.cshtml deleted file mode 100644 index 77b65af1c3..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/_PageStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/_ViewImports.cshtml b/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/_ViewImports.cshtml deleted file mode 100644 index fcd6f860b6..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Pages/_ViewImports.cshtml +++ /dev/null @@ -1 +0,0 @@ -@using RazorPagesApp diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Program.cs b/src/MvcPrecompilation/testapps/RazorPagesApp/Program.cs deleted file mode 100644 index 6007a0387a..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace RazorPagesApp -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/RazorPagesApp.csproj b/src/MvcPrecompilation/testapps/RazorPagesApp/RazorPagesApp.csproj deleted file mode 100644 index f2eb5223ff..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/RazorPagesApp.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(StandardTestAppTfms) - - true - - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Startup.cs b/src/MvcPrecompilation/testapps/RazorPagesApp/Startup.cs deleted file mode 100644 index 33964de1da..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Startup.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace RazorPagesApp -{ - public class Startup : IDesignTimeMvcBuilderConfiguration - { - public void ConfigureServices(IServiceCollection services) - { - var builder = services.AddMvc(); - services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options => options.LoginPath = "/Login"); - ConfigureMvc(builder); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseAuthentication(); - app.UseMvc(); - } - - public void ConfigureMvc(IMvcBuilder builder) - { - builder.AddRazorPagesOptions(options => - { - options.RootDirectory = "/Pages"; - options.Conventions.AuthorizeFolder("/Auth"); - }); - } - } -} diff --git a/src/MvcPrecompilation/testapps/RazorPagesApp/Views/Shared/_Layout.cshtml b/src/MvcPrecompilation/testapps/RazorPagesApp/Views/Shared/_Layout.cshtml deleted file mode 100644 index 20b44df8d1..0000000000 --- a/src/MvcPrecompilation/testapps/RazorPagesApp/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,3 +0,0 @@ - -@RenderBody() - \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/SimpleApp/Controllers/HomeController.cs b/src/MvcPrecompilation/testapps/SimpleApp/Controllers/HomeController.cs deleted file mode 100644 index 9798d3cc1b..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleApp/Controllers/HomeController.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace SimpleApp.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public IActionResult About() - { - ViewData["Message"] = "Your application description page."; - - return View(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/SimpleApp/Program.cs b/src/MvcPrecompilation/testapps/SimpleApp/Program.cs deleted file mode 100644 index 6ed39c5e32..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleApp/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace SimpleApp -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/SimpleApp/SimpleApp.csproj b/src/MvcPrecompilation/testapps/SimpleApp/SimpleApp.csproj deleted file mode 100644 index f330f2386d..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleApp/SimpleApp.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - $(StandardTestAppTfms) - true - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/SimpleApp/Startup.cs b/src/MvcPrecompilation/testapps/SimpleApp/Startup.cs deleted file mode 100644 index 461873a890..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleApp/Startup.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace SimpleApp -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddMvc(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - } -} diff --git a/src/MvcPrecompilation/testapps/SimpleApp/Views/Home/About.cshtml b/src/MvcPrecompilation/testapps/SimpleApp/Views/Home/About.cshtml deleted file mode 100644 index 50476d1fbd..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleApp/Views/Home/About.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - ViewData["Title"] = "About"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -

Use this area to provide additional information.

diff --git a/src/MvcPrecompilation/testapps/SimpleApp/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/SimpleApp/Views/Home/Index.cshtml deleted file mode 100644 index e6b0e16e90..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleApp/Views/Home/Index.cshtml +++ /dev/null @@ -1,110 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -@GetType().Assembly.FullName - - - diff --git a/src/MvcPrecompilation/testapps/SimpleApp/Views/Shared/_Layout.cshtml b/src/MvcPrecompilation/testapps/SimpleApp/Views/Shared/_Layout.cshtml deleted file mode 100644 index 4ec1363ad9..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleApp/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - @ViewData["Title"] - SimpleApp - - - - - - - - - - - - -
- @RenderBody() -
-
-

© 2016 - SimpleApp

-
-
- - - - - - - - - - - - - @RenderSection("scripts", required: false) - @GetType().Assembly.FullName - - diff --git a/src/MvcPrecompilation/testapps/SimpleApp/Views/_ViewImports.cshtml b/src/MvcPrecompilation/testapps/SimpleApp/Views/_ViewImports.cshtml deleted file mode 100644 index 71413f674c..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleApp/Views/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using SimpleApp -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/MvcPrecompilation/testapps/SimpleApp/Views/_ViewStart.cshtml b/src/MvcPrecompilation/testapps/SimpleApp/Views/_ViewStart.cshtml deleted file mode 100644 index a5f10045db..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleApp/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Controllers/HomeController.cs b/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Controllers/HomeController.cs deleted file mode 100644 index ff4fec1f47..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Controllers/HomeController.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace SimpleAppWithAssemblyRename.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Program.cs b/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Program.cs deleted file mode 100644 index a8e6434358..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace SimpleAppWithAssemblyRename -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj b/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj deleted file mode 100644 index 73de429042..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - NewAssemblyName - $(StandardTestAppTfms) - - true - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Startup.cs b/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Startup.cs deleted file mode 100644 index fa29d5b735..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Startup.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace SimpleAppWithAssemblyRename -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddMvc(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvcWithDefaultRoute(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Views/Home/Index.cshtml deleted file mode 100644 index 643d80ddc2..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Views/Home/Index.cshtml +++ /dev/null @@ -1,5 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -@GetType().Assembly.FullName \ No newline at end of file diff --git a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Views/_ViewImports.cshtml b/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Views/_ViewImports.cshtml deleted file mode 100644 index f6579ad342..0000000000 --- a/src/MvcPrecompilation/testapps/SimpleAppWithAssemblyRename/Views/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using SimpleAppWithAssemblyRename -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/MvcPrecompilation/testapps/StrongNamedApp/Controllers/HomeController.cs b/src/MvcPrecompilation/testapps/StrongNamedApp/Controllers/HomeController.cs deleted file mode 100644 index 8877a4cc81..0000000000 --- a/src/MvcPrecompilation/testapps/StrongNamedApp/Controllers/HomeController.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace StrongNamedApp.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() => View(); - } -} diff --git a/src/MvcPrecompilation/testapps/StrongNamedApp/Program.cs b/src/MvcPrecompilation/testapps/StrongNamedApp/Program.cs deleted file mode 100644 index 52868ba38a..0000000000 --- a/src/MvcPrecompilation/testapps/StrongNamedApp/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace StrongNamedApp -{ - public class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/MvcPrecompilation/testapps/StrongNamedApp/Startup.cs b/src/MvcPrecompilation/testapps/StrongNamedApp/Startup.cs deleted file mode 100644 index a75f450846..0000000000 --- a/src/MvcPrecompilation/testapps/StrongNamedApp/Startup.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace StrongNamedApp -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddMvc(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - } -} diff --git a/src/MvcPrecompilation/testapps/StrongNamedApp/StrongNamedApp.csproj b/src/MvcPrecompilation/testapps/StrongNamedApp/StrongNamedApp.csproj deleted file mode 100644 index f76a4cc9f4..0000000000 --- a/src/MvcPrecompilation/testapps/StrongNamedApp/StrongNamedApp.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(StandardTestAppTfms) - true - - true - - - - - - - - - - diff --git a/src/MvcPrecompilation/testapps/StrongNamedApp/Views/Home/Index.cshtml b/src/MvcPrecompilation/testapps/StrongNamedApp/Views/Home/Index.cshtml deleted file mode 100644 index a3c823f4f3..0000000000 --- a/src/MvcPrecompilation/testapps/StrongNamedApp/Views/Home/Index.cshtml +++ /dev/null @@ -1 +0,0 @@ -Hello from view in @GetType().Assembly.FullName diff --git a/src/MvcPrecompilation/version.props b/src/MvcPrecompilation/version.props deleted file mode 100644 index 71a78cddd8..0000000000 --- a/src/MvcPrecompilation/version.props +++ /dev/null @@ -1,12 +0,0 @@ - - - 3.0.0 - alpha1 - $(VersionPrefix) - $(VersionPrefix)-$(VersionSuffix)-final - t000 - a- - $(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) - $(VersionSuffix)-$(BuildNumber) - -