parent
822cb35624
commit
8f085c8e5d
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26118.1
|
||||
VisualStudioVersion = 15.0.26123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
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
|
||||
|
|
@ -24,6 +24,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{87FEE984
|
|||
build\common.props = build\common.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86", "pack\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.csproj", "{9F47A520-7DAB-409D-81C8-AD351562A1A5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -69,6 +71,18 @@ Global
|
|||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x64.Build.0 = Release|x64
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x86.ActiveCfg = Release|x86
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x86.Build.0 = Release|x86
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Debug|x64.Build.0 = Debug|x64
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Debug|x86.Build.0 = Debug|x86
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Release|x64.ActiveCfg = Release|x64
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Release|x64.Build.0 = Release|x64
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Release|x86.ActiveCfg = Release|x86
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -77,5 +91,6 @@ Global
|
|||
{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}
|
||||
{9F47A520-7DAB-409D-81C8-AD351562A1A5} = {02F7AA35-91AF-491E-9F0E-03CFAF86C720}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<Import Project="..\build\common.props" />
|
||||
<PropertyGroup>
|
||||
<Description>Build-time references required to enable Razor view compilation as part of building the application.</Description>
|
||||
<TargetFrameworks>net451</TargetFrameworks>
|
||||
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
|
||||
<OutputType>exe</OutputType>
|
||||
<ViewCompilationProjectPath>..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation</ViewCompilationProjectPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(ViewCompilationProjectPath)\*.cs;" />
|
||||
<Compile Include="$(ViewCompilationProjectPath)\Internal\*.cs;" />
|
||||
<Compile Include="$(ViewCompilationProjectPath)\Properties\*.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,29 +1,28 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<Import Project="..\..\build\common.props" />
|
||||
<PropertyGroup>
|
||||
<Description>Build-time references required to enable Razor view compilation as part of building the application.</Description>
|
||||
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
|
||||
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
|
||||
<PackageTags>cshtml;razor;compilation;precompilation;aspnetcore</PackageTags>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>exe</OutputType>
|
||||
|
||||
<!-- Include the build outputs in the build directory (and not the lib directory) -->
|
||||
<BuildOutputTargetFolder>build</BuildOutputTargetFolder>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="build\**\*" Pack="true" PackagePath="%(Identity)" />
|
||||
<None Include="buildMultiTargeting/*" Pack="true" PackagePath="%(Identity)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<Import Project="..\..\build\common.props" />
|
||||
<PropertyGroup>
|
||||
<Description>Build-time references required to enable Razor view compilation as part of building the application.</Description>
|
||||
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
|
||||
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
|
||||
<PackageTags>cshtml;razor;compilation;precompilation;aspnetcore</PackageTags>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>exe</OutputType>
|
||||
<X86ProjectDirectory>..\..\pack\</X86ProjectDirectory>
|
||||
<!-- Include the build outputs in the build directory (and not the lib directory) -->
|
||||
<BuildOutputTargetFolder>build</BuildOutputTargetFolder>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="build\**\*" Pack="true" PackagePath="%(Identity)" />
|
||||
<None Include="buildMultiTargeting/*" Pack="true" PackagePath="%(Identity)" />
|
||||
<None Include="$(X86ProjectDirectory)\bin\$(Configuration)\net451\$(MSBuildThisFileName)-x86.exe" Pack="true" PackagePath="build\net451\$(MSBuildThisFileName)-x86.exe" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.0" />
|
||||
<ProjectReference Include="$(X86ProjectDirectory)$(MSBuildThisFileName)-x86.csproj" PrivateAssets="true" ReferenceOutputAssembly="false" Condition="'$(TargetFramework)'=='net451'" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -2,8 +2,6 @@
|
|||
// 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.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\common.targets" />
|
||||
<PropertyGroup>
|
||||
<MvcRazorRunCommand Condition="'$(MvcRazorRunCommand)'==''">$(OutputPath)$(MSBuildThisFileName).exe</MvcRazorRunCommand>
|
||||
<PropertyGroup Condition="'$(MvcRazorRunCommand)'==''">
|
||||
<MvcRazorRunCommand Condition="'$(PlatformTarget)'=='x86'">$(OutputPath)$(MSBuildThisFileName)-x86.exe</MvcRazorRunCommand>
|
||||
<MvcRazorRunCommand Condition="'$(PlatformTarget)'!='x86'">$(OutputPath)$(MSBuildThisFileName).exe</MvcRazorRunCommand>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target
|
||||
|
|
@ -12,12 +13,21 @@
|
|||
|
||||
<CallTarget Targets="_CreateResponseFileForMvcRazorPrecompile" />
|
||||
|
||||
<ItemGroup>
|
||||
<ItemGroup Condition="'$(PlatformTarget)'=='x86'">
|
||||
<FilesToCopy Include="$(OutputPath)$(AssemblyName).exe.config">
|
||||
<Destination>$(OutputPath)$(MSBuildThisFileName)-x86.exe.config</Destination>
|
||||
</FilesToCopy>
|
||||
<FilesToCopy Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName)-x86.exe">
|
||||
<Destination>$(OutputPath)$(MSBuildThisFileName)-x86.exe</Destination>
|
||||
</FilesToCopy>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(PlatformTarget)'!='x86'">
|
||||
<FilesToCopy Include="$(OutputPath)$(AssemblyName).exe.config" Condition="">
|
||||
<Destination>$(OutputPath)$(MSBuildThisFileName).exe.config</Destination>
|
||||
</FilesToCopy>
|
||||
<FilesToCopy Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).exe">
|
||||
<Destination>$(MvcRazorRunCommand)</Destination>
|
||||
<Destination>$(OutputPath)$(MSBuildThisFileName).exe</Destination>
|
||||
</FilesToCopy>
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
AspNetCore._Views_Home_Index_cshtml, SimpleAppX86DesktopOnly.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
// 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 Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation
|
||||
{
|
||||
public class SimpleAppX86DesktopOnlyTest : IClassFixture<SimpleAppX86DesktopOnlyTest.SimpleAppX86DesktopOnlyFixture>
|
||||
{
|
||||
public SimpleAppX86DesktopOnlyTest(SimpleAppX86DesktopOnlyFixture fixture)
|
||||
{
|
||||
Fixture = fixture;
|
||||
}
|
||||
|
||||
public ApplicationTestFixture Fixture { get; }
|
||||
|
||||
[ConditionalFact]
|
||||
[OSSkipCondition(OperatingSystems.Linux)]
|
||||
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||
public async Task Precompilation_WorksForSimpleApps()
|
||||
{
|
||||
// Arrange
|
||||
using (var deployer = Fixture.CreateDeployment(RuntimeFlavor.Clr))
|
||||
{
|
||||
var deploymentResult = deployer.Deploy();
|
||||
|
||||
// Act
|
||||
var response = await Fixture.HttpClient.GetStringWithRetryAsync(
|
||||
deploymentResult.ApplicationBaseUri,
|
||||
Fixture.Logger);
|
||||
|
||||
// Assert
|
||||
TestEmbeddedResource.AssertContent("SimpleAppX86DesktopOnly.Home.Index.txt", response);
|
||||
}
|
||||
}
|
||||
|
||||
public class SimpleAppX86DesktopOnlyFixture : ApplicationTestFixture
|
||||
{
|
||||
public SimpleAppX86DesktopOnlyFixture()
|
||||
: base("SimpleAppX86DesktopOnly")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace SimpleApp.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public IActionResult Index() => View();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
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<Startup>()
|
||||
.Build();
|
||||
|
||||
host.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net451</TargetFramework>
|
||||
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>Exe</OutputType>
|
||||
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation">
|
||||
<Version>1.1.0-*</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
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?}");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
@GetType().AssemblyQualifiedName
|
||||
Loading…
Reference in New Issue