diff --git a/Mvc.sln b/Mvc.sln index 252acd505d..e6a4c9cd93 100644 --- a/Mvc.sln +++ b/Mvc.sln @@ -106,8 +106,6 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.TagHel EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.TagHelpers.Test", "test\Microsoft.AspNet.Mvc.TagHelpers.Test\Microsoft.AspNet.Mvc.TagHelpers.Test.kproj", "{860119ED-3DB1-424D-8D0A-30132A8A7D96}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PrecompilationWebSite", "test\WebSites\PrecompilationWebSite\PrecompilationWebSite.kproj", "{59E1BE90-92C1-4D35-ADCC-B69F49077C81}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -568,16 +566,6 @@ Global {860119ED-3DB1-424D-8D0A-30132A8A7D96}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {860119ED-3DB1-424D-8D0A-30132A8A7D96}.Release|Mixed Platforms.Build.0 = Release|Any CPU {860119ED-3DB1-424D-8D0A-30132A8A7D96}.Release|x86.ActiveCfg = Release|Any CPU - {59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Debug|x86.ActiveCfg = Debug|Any CPU - {59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Release|Any CPU.Build.0 = Release|Any CPU - {59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -629,6 +617,5 @@ Global {2223120F-D675-40DA-8CD8-11DC14A0B2C7} = {DAAE4C74-D06F-4874-A166-33305D2643CE} {B2347320-308E-4D2B-AEC8-005DFA68B0C9} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E} {860119ED-3DB1-424D-8D0A-30132A8A7D96} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} - {59E1BE90-92C1-4D35-ADCC-B69F49077C81} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C} EndGlobalSection EndGlobal diff --git a/samples/MvcSample.Web/Compiler/PreProcess/RazorPreCompilation.cs b/samples/MvcSample.Web/Compiler/PreProcess/RazorPreCompilation.cs deleted file mode 100644 index 004f1ed655..0000000000 --- a/samples/MvcSample.Web/Compiler/PreProcess/RazorPreCompilation.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. 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.AspNet.Mvc; - -namespace MvcSample.Web -{ - public class MyCompilation : RazorPreCompileModule - { - public MyCompilation(IServiceProvider provider) : base(provider) - { - } - } -} \ No newline at end of file diff --git a/samples/MvcSample.Web/Views/Shared/MyView.cshtml b/samples/MvcSample.Web/Views/Shared/MyView.cshtml index 8fbe48d3f6..d2ed197537 100644 --- a/samples/MvcSample.Web/Views/Shared/MyView.cshtml +++ b/samples/MvcSample.Web/Views/Shared/MyView.cshtml @@ -35,9 +35,9 @@ } @functions { - public Task AsyncValueRetrieval() + public async Task AsyncValueRetrieval() { - return Task.FromResult("Hello World"); + return "Hello World"; } public Task RenderHelloWorldPartial(User model) diff --git a/src/PrecompilationWebSite/PrecompilationWebSite.kproj b/src/PrecompilationWebSite/PrecompilationWebSite.kproj deleted file mode 100644 index 61d0148291..0000000000 --- a/src/PrecompilationWebSite/PrecompilationWebSite.kproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 7af02e0f-a0cd-4a79-8c48-b5decfdd9df6 - PrecompilationWebSite - - - 2.0 - 34201 - - - \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/PrecompilationTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/PrecompilationTest.cs deleted file mode 100644 index 985905a773..0000000000 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/PrecompilationTest.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. 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; -using System.Reflection; -using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.TestHost; -using Xunit; - -namespace Microsoft.AspNet.Mvc.FunctionalTests -{ - public class PrecompilationTest - { - private readonly IServiceProvider _services = TestHelper.CreateServices("PrecompilationWebSite"); - private readonly Action _app = new PrecompilationWebSite.Startup().Configure; - - [Fact] - public async Task PrecompiledView_RendersCorrectly() - { - // Arrange - var server = TestServer.Create(_services, _app); - var client = server.CreateClient(); - - // We will render a view that writes the fully qualified name of the Assembly containing the type of - // the view. If the view is precompiled, this assembly will be PrecompilationWebsite. - var expectedContent = typeof(PrecompilationWebSite.Startup).GetTypeInfo().Assembly.GetName().ToString(); - - // Act - var response = await client.GetAsync("http://localhost/Home/Index"); - var responseContent = await response.Content.ReadAsStringAsync(); - - // Assert - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - Assert.Equal(expectedContent, responseContent); - } - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/project.json b/test/Microsoft.AspNet.Mvc.FunctionalTests/project.json index b334fcb8a7..f38d7d4cdd 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/project.json +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/project.json @@ -17,7 +17,6 @@ "InlineConstraintsWebSite": "1.0.0", "ModelBindingWebSite": "1.0.0", "MvcSample.Web": "1.0.0", - "PrecompilationWebSite": "1.0.0", "RoutingWebSite": "1.0.0", "RazorWebSite": "1.0.0", "RazorInstrumentationWebsite": "1.0.0", diff --git a/test/WebSites/PrecompilationWebSite/Compiler/PreProcess/RazorPreCompilation.cs b/test/WebSites/PrecompilationWebSite/Compiler/PreProcess/RazorPreCompilation.cs deleted file mode 100644 index 52d8a22f9c..0000000000 --- a/test/WebSites/PrecompilationWebSite/Compiler/PreProcess/RazorPreCompilation.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. 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.Runtime.Versioning; -using Microsoft.AspNet.Mvc; -using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; -using Microsoft.Framework.Runtime; - -namespace PrecompilationWebSite -{ - public class MyCompilation : RazorPreCompileModule - { - public MyCompilation(IServiceProvider provider) : base(ReplaceProvider(provider)) - { - } - - // When running in memory tests the application base path will point to the functional tests - // project folder. - // We need to replace it to point to the actual precompilation website so that the views can - // be found. - public static IServiceProvider ReplaceProvider(IServiceProvider provider) - { - var originalEnvironment = provider.GetService(); - var newPath = Path.GetFullPath( - Path.Combine( - originalEnvironment.ApplicationBasePath, - "..", - "WebSites", - "PrecompilationWebSite")); - - var precompilationApplicationEnvironment = new PrecompilationApplicationEnvironment( - originalEnvironment, - newPath); - - var collection = new ServiceCollection(); - collection.AddInstance(precompilationApplicationEnvironment); - - return collection.BuildServiceProvider(provider); - } - - private class PrecompilationApplicationEnvironment : IApplicationEnvironment - { - private readonly IApplicationEnvironment _originalApplicationEnvironment; - private readonly string _applicationBasePath; - - public PrecompilationApplicationEnvironment(IApplicationEnvironment original, string appBasePath) - { - _originalApplicationEnvironment = original; - _applicationBasePath = appBasePath; - } - - public string ApplicationName - { - get { return _originalApplicationEnvironment.ApplicationName; } - } - - public string Version - { - get { return _originalApplicationEnvironment.Version; } - } - - public string ApplicationBasePath - { - get { return _applicationBasePath; } - } - - public string Configuration - { - get - { - return _originalApplicationEnvironment.Configuration; - } - } - - public FrameworkName RuntimeFramework - { - get { return _originalApplicationEnvironment.RuntimeFramework; } - } - } - } -} \ No newline at end of file diff --git a/test/WebSites/PrecompilationWebSite/Controllers/HomeController.cs b/test/WebSites/PrecompilationWebSite/Controllers/HomeController.cs deleted file mode 100644 index bdff9e4876..0000000000 --- a/test/WebSites/PrecompilationWebSite/Controllers/HomeController.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.AspNet.Mvc; - -namespace PrecompilationWebSite.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - } -} diff --git a/test/WebSites/PrecompilationWebSite/PrecompilationWebSite.kproj b/test/WebSites/PrecompilationWebSite/PrecompilationWebSite.kproj deleted file mode 100644 index 87949c61f0..0000000000 --- a/test/WebSites/PrecompilationWebSite/PrecompilationWebSite.kproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 59e1be90-92c1-4d35-adcc-b69f49077c81 - PrecompilationWebSite - - - 2.0 - 34231 - - - \ No newline at end of file diff --git a/test/WebSites/PrecompilationWebSite/Startup.cs b/test/WebSites/PrecompilationWebSite/Startup.cs deleted file mode 100644 index 0d99e31a5a..0000000000 --- a/test/WebSites/PrecompilationWebSite/Startup.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Routing; -using Microsoft.Framework.DependencyInjection; - -namespace PrecompilationWebSite -{ - public class Startup - { - public void Configure(IApplicationBuilder app) - { - var configuration = app.GetTestConfiguration(); - - app.UseServices(services => - { - services.AddMvc(configuration); - }); - - app.UseMvc(); - } - } -} diff --git a/test/WebSites/PrecompilationWebSite/Views/Home/Index.cshtml b/test/WebSites/PrecompilationWebSite/Views/Home/Index.cshtml deleted file mode 100644 index 97580a0513..0000000000 --- a/test/WebSites/PrecompilationWebSite/Views/Home/Index.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using System.Reflection -@(GetType().GetTypeInfo().Assembly.GetName()) \ No newline at end of file diff --git a/test/WebSites/PrecompilationWebSite/project.json b/test/WebSites/PrecompilationWebSite/project.json deleted file mode 100644 index 74663e7fc8..0000000000 --- a/test/WebSites/PrecompilationWebSite/project.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "dependencies": { - "Microsoft.AspNet.Mvc": "6.0.0-*", - "Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", - "Microsoft.AspNet.Server.IIS": "1.0.0-*", - "Microsoft.AspNet.Server.WebListener": "1.0.0-*" - }, - "frameworks": { - "aspnet50": { }, - "aspnetcore50": { } - }, - "webroot": "." -}