Copy precompiled pdb to publish directory

Fixes #98
This commit is contained in:
Pranav K 2017-06-19 11:24:55 -07:00
Родитель ebf207cea4
Коммит 900f38b0c2
2 изменённых файлов: 22 добавлений и 0 удалений

Просмотреть файл

@ -57,6 +57,10 @@
AfterTargets="ComputeRefAssembliesToPublish"
Condition="'$(MvcRazorCompileOnPublish)'=='true'">
<PropertyGroup>
<_MvcRazorOutputPdbFullPath>$([System.IO.Path]::ChangeExtension('$(_MvcRazorOutputFullPath)', '.pdb'))</_MvcRazorOutputPdbFullPath>
</PropertyGroup>
<ItemGroup>
<ResolvedFileToPublish
Remove="%(MvcRazorFilesToCompile.FullPath)"
@ -65,6 +69,10 @@
<ResolvedFileToPublish Include="$(_MvcRazorOutputFullPath)" CopyToPublishDirectory="Always">
<RelativePath>$([System.IO.Path]::GetFileName('$(_MvcRazorOutputFullPath)'))</RelativePath>
</ResolvedFileToPublish>
<ResolvedFileToPublish Include="$(_MvcRazorOutputPdbFullPath)" CopyToPublishDirectory="Always">
<RelativePath>$([System.IO.Path]::GetFileName('$(_MvcRazorOutputPdbFullPath)'))</RelativePath>
</ResolvedFileToPublish>
</ItemGroup>
<ItemGroup Condition="'$(MvcRazorExcludeRefAssembliesFromPublish)'=='true'">

Просмотреть файл

@ -52,6 +52,20 @@ namespace FunctionalTests
}
}
[ConditionalTheory]
[MemberData(nameof(SupportedFlavorsTheoryData))]
public async Task Precompilation_PublishesPdbsToOutputDirectory(RuntimeFlavor flavor)
{
// Arrange
using (var deployment = await Fixture.CreateDeploymentAsync(flavor))
{
var pdbPath = Path.Combine(deployment.DeploymentResult.ContentRoot, Fixture.ApplicationName + ".PrecompiledViews.pdb");
// Act & Assert
Assert.True(File.Exists(pdbPath), $"PDB at {pdbPath} was not found.");
}
}
public class TestFixture : ApplicationTestFixture
{
public TestFixture()