Change the default extension for Razor views to .Views.dll

This commit is contained in:
Pranav K 2018-02-20 15:16:07 -08:00
parent fed0970b33
commit 8938f6c8c2
10 changed files with 125 additions and 117 deletions

View File

@ -5,5 +5,10 @@
MVC will generally want to add support for runtime compilation, but only for applications.
-->
<GenerateRazorAssemblyInfo Condition="'$(GenerateRazorAssemblyInfo)'=='' and '$(OutputType)'=='Exe'">true</GenerateRazorAssemblyInfo>
<!--
Use the suffix .Views when producing compiled view assemblies. This matches the requirements for Mvc's ViewsFeatureProvider.
-->
<RazorTargetNameSuffix Condition="'$(RazorTargetNameSuffix)'==''">.Views</RazorTargetNameSuffix>
</PropertyGroup>
</Project>
</Project>

View File

@ -91,9 +91,12 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<!-- Output directory used for generated files -->
<RazorGenerateIntermediateOutputPath Condition="'$(RazorGenerateIntermediateOutputPath)'==''">$(IntermediateOutputPath)Razor\</RazorGenerateIntermediateOutputPath>
<!-- Suffix appended to $(TargetName) to produce $(RazorTargetName), the name of the assembly produced by Razor -->
<RazorTargetNameSuffix Condition="'$(RazorTargetNameSuffix)' == ''">.Razor</RazorTargetNameSuffix>
<!-- File name (without extension) of the assembly produced by Razor -->
<RazorTargetName Condition="'$(RazorTargetName)'==''">$(TargetName).PrecompiledViews</RazorTargetName>
<RazorTargetName Condition="'$(RazorTargetName)'==''">$(TargetName)$(RazorTargetNameSuffix)</RazorTargetName>
<!--
The compatibility zone - these properties were provided by the MVC Precompilation tool and they

View File

@ -30,14 +30,14 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, OutputPath, "SimpleMvc.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.Views.pdb");
if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// GetFullPath on OSX doesn't work well in travis. We end up computing a different path than will
// end up in the MSBuild logs.
Assert.BuildOutputContainsLine(result, $"SimpleMvc -> {Path.Combine(Path.GetFullPath(Project.DirectoryPath), OutputPath, "SimpleMvc.PrecompiledViews.dll")}");
Assert.BuildOutputContainsLine(result, $"SimpleMvc -> {Path.Combine(Path.GetFullPath(Project.DirectoryPath), OutputPath, "SimpleMvc.Views.dll")}");
}
result = await DotnetMSBuild("_IntrospectPreserveCompilationContext");
@ -57,8 +57,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, OutputPath, "SimpleMvc.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.pdb");
result = await DotnetMSBuild("_IntrospectPreserveCompilationContext");
@ -77,8 +77,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, OutputPath, "SimpleMvc.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -97,7 +97,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// Compilation failed without creating the views assembly
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
}
[Fact]
@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimplePages.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimplePages.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimplePages.Views.dll");
}
[Fact]
@ -121,11 +121,11 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, customOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, customOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, customOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, customOutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -137,11 +137,11 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, customOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, customOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, customOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, customOutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -153,10 +153,10 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.dll");
}
[Fact]
@ -167,10 +167,10 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -182,11 +182,11 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -199,12 +199,12 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.FileExists(result, OutputPath, "AppWithP2PReference.dll");
Assert.FileExists(result, OutputPath, "AppWithP2PReference.pdb");
Assert.FileExists(result, OutputPath, "AppWithP2PReference.PrecompiledViews.dll");
Assert.FileExists(result, OutputPath, "AppWithP2PReference.PrecompiledViews.pdb");
Assert.FileExists(result, OutputPath, "AppWithP2PReference.Views.dll");
Assert.FileExists(result, OutputPath, "AppWithP2PReference.Views.pdb");
Assert.FileExists(result, OutputPath, "ClassLibrary.dll");
Assert.FileExists(result, OutputPath, "ClassLibrary.pdb");
Assert.FileExists(result, OutputPath, "ClassLibrary.PrecompiledViews.dll");
Assert.FileExists(result, OutputPath, "ClassLibrary.PrecompiledViews.pdb");
Assert.FileExists(result, OutputPath, "ClassLibrary.Views.dll");
Assert.FileExists(result, OutputPath, "ClassLibrary.Views.pdb");
}
[Fact]

View File

@ -30,8 +30,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, OutputPath, "SimpleMvc.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -45,8 +45,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, OutputPath, "SimpleMvc.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -60,10 +60,10 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, OutputPath, "Whitespace in name.dll");
Assert.FileExists(result, OutputPath, "Whitespace in name.pdb");
Assert.FileExists(result, OutputPath, "Whitespace in name.PrecompiledViews.dll");
Assert.FileExists(result, OutputPath, "Whitespace in name.PrecompiledViews.pdb");
Assert.FileExists(result, OutputPath, "Whitespace in name.Views.dll");
Assert.FileExists(result, OutputPath, "Whitespace in name.Views.pdb");
Assert.FileExists(result, IntermediateOutputPath, "Whitespace in name.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "Whitespace in name.Views.dll");
Assert.FileExists(result, IntermediateOutputPath, "Whitespace in name.RazorCoreGenerate.cache");
Assert.FileExists(result, RazorIntermediateOutputPath, "Views", "Home", "Index.cs");
}

View File

@ -17,8 +17,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.AssemblyInfo.cs");
Assert.FileContainsLine(
@ -43,8 +43,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.AssemblyInfo.cs");
Assert.FileDoesNotContainLine(
@ -69,8 +69,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "ClassLibrary.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "ClassLibrary.PrecompiledViews.pdb");
Assert.FileExists(result, IntermediateOutputPath, "ClassLibrary.Views.dll");
Assert.FileExists(result, IntermediateOutputPath, "ClassLibrary.Views.pdb");
Assert.FileExists(result, IntermediateOutputPath, "ClassLibrary.AssemblyInfo.cs");
Assert.FileDoesNotContainLine(

View File

@ -19,8 +19,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.pdb");
// This target should be part of the design time build.
Assert.Contains("RazorGetAssemblyAttributes", result.Output);

View File

@ -18,13 +18,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, OutputPath, "ClassLibrary.dll");
Assert.FileExists(result, OutputPath, "ClassLibrary.PrecompiledViews.dll");
Assert.FileExists(result, OutputPath, "ClassLibrary.Views.dll");
Assert.NuspecContains(
result,
Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"),
$"<file src=\"{Path.Combine("bin", Configuration, "netcoreapp2.0", "ClassLibrary.PrecompiledViews.dll")}\" " +
$"target=\"{Path.Combine("lib", "netcoreapp2.0", "ClassLibrary.PrecompiledViews.dll")}\" />");
$"<file src=\"{Path.Combine("bin", Configuration, "netcoreapp2.0", "ClassLibrary.Views.dll")}\" " +
$"target=\"{Path.Combine("lib", "netcoreapp2.0", "ClassLibrary.Views.dll")}\" />");
Assert.NuspecDoesNotContain(
result,
@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.NupkgContains(
result,
Path.Combine("bin", Configuration, "ClassLibrary.1.0.0.nupkg"),
Path.Combine("lib", "netcoreapp2.0", "ClassLibrary.PrecompiledViews.dll"));
Path.Combine("lib", "netcoreapp2.0", "ClassLibrary.Views.dll"));
}
[Fact]
@ -46,13 +46,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, OutputPath, "ClassLibrary.dll");
Assert.FileExists(result, OutputPath, "ClassLibrary.PrecompiledViews.dll");
Assert.FileExists(result, OutputPath, "ClassLibrary.Views.dll");
Assert.NuspecContains(
result,
Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"),
$"<file src=\"{Path.Combine("bin", Configuration, "netcoreapp2.0", "ClassLibrary.PrecompiledViews.dll")}\" " +
$"target=\"{Path.Combine("lib", "netcoreapp2.0", "ClassLibrary.PrecompiledViews.dll")}\" />");
$"<file src=\"{Path.Combine("bin", Configuration, "netcoreapp2.0", "ClassLibrary.Views.dll")}\" " +
$"target=\"{Path.Combine("lib", "netcoreapp2.0", "ClassLibrary.Views.dll")}\" />");
Assert.NuspecContains(
result,
@ -62,7 +62,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.NupkgContains(
result,
Path.Combine("bin", Configuration, "ClassLibrary.1.0.0.nupkg"),
Path.Combine("lib", "netcoreapp2.0", "ClassLibrary.PrecompiledViews.dll"));
Path.Combine("lib", "netcoreapp2.0", "ClassLibrary.Views.dll"));
}
}
}

View File

@ -17,13 +17,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.pdb");
// By default refs and .cshtml files will not be copied on publish
Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "refs"), "*.dll");
@ -40,13 +40,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.FileExists(result, OutputPath, "SimpleMvc.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.pdb");
// By default refs and .cshtml files will not be copied on publish
Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "refs"), "*.dll");
@ -61,13 +61,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.pdb");
// By default refs and .cshtml files will not be copied on publish
Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "refs"), "*.dll");
@ -84,8 +84,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.pdb");
}
[Fact] // This is an override to force the new toolset
@ -96,13 +96,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.pdb");
// By default refs and .cshtml files will not be copied on publish
Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "refs"), "*.dll");
@ -122,8 +122,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// Everything we do should noop - including building the app.
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -137,8 +137,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// Everything we do should noop - including building the app.
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -154,8 +154,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// Everything we do should noop - including building the app.
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -167,10 +167,10 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.dll");
}
[Fact]
@ -181,10 +181,10 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -196,11 +196,11 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -211,13 +211,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.pdb");
// By default refs and .cshtml files will not be copied on publish
Assert.FileExists(result, PublishOutputPath, "refs", "mscorlib.dll");
@ -232,13 +232,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.Views.pdb");
// By default refs and .cshtml files will not be copied on publish
Assert.FileExists(result, PublishOutputPath, "refs", "mscorlib.dll");
@ -255,12 +255,12 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.dll");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.pdb");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.Views.dll");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.dll");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.pdb");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.Views.dll");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.Views.pdb");
}
[Fact]
@ -271,19 +271,19 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileDoesNotExist(result, OutputPath, "AppWithP2PReference.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "AppWithP2PReference.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "ClassLibrary.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, OutputPath, "ClassLibrary.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, OutputPath, "AppWithP2PReference.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "AppWithP2PReference.Views.pdb");
Assert.FileDoesNotExist(result, OutputPath, "ClassLibrary.Views.dll");
Assert.FileDoesNotExist(result, OutputPath, "ClassLibrary.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.dll");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.pdb");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.Views.dll");
Assert.FileExists(result, PublishOutputPath, "AppWithP2PReference.Views.pdb");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.dll");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.pdb");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.PrecompiledViews.dll");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.PrecompiledViews.pdb");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.Views.dll");
Assert.FileExists(result, PublishOutputPath, "ClassLibrary.Views.pdb");
}
}
}

View File

@ -22,8 +22,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// RazorGenerate should compile the assembly and pdb.
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -39,8 +39,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// Everything we do should noop - including building the app.
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.pdb");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.pdb");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
}
[Fact]
@ -51,9 +51,9 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
var assembly = LoadAssemblyFromBytes(result.Project.DirectoryPath, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
var assembly = LoadAssemblyFromBytes(result.Project.DirectoryPath, IntermediateOutputPath, "SimpleMvc.Views.dll");
var resources = assembly.GetManifestResourceNames();
Assert.Equal(new string[]
@ -78,9 +78,9 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
var assembly = LoadAssemblyFromBytes(result.Project.DirectoryPath, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
var assembly = LoadAssemblyFromBytes(result.Project.DirectoryPath, IntermediateOutputPath, "SimpleMvc.Views.dll");
var resources = assembly.GetManifestResourceNames();
Assert.Equal(new string[]

View File

@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// RazorGenerate should compile the assembly, but not the views.
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, RazorIntermediateOutputPath, "Views", "_ViewImports.cs");
Assert.FileExists(result, RazorIntermediateOutputPath, "Views", "_ViewStart.cs");
@ -53,7 +53,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// RazorGenerate should compile the assembly, but not the views.
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
// The file should still be generated even if we had a Razor syntax error.
Assert.FileExists(result, RazorIntermediateOutputPath, "Views", "Home", "Index.cs");
@ -313,7 +313,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// RazorGenerate should compile the assembly, but not the views.
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.PrecompiledViews.dll");
Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, RazorIntermediateOutputPath, "Views", "_ViewImports.cs");
Assert.FileExists(result, RazorIntermediateOutputPath, "Views", "_ViewStart.cs");