Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Commit

Permalink
Copy precompiled pdb to publish directory
Browse files Browse the repository at this point in the history
Fixes #98
  • Loading branch information
pranavkm committed Jun 19, 2017
1 parent ebf207c commit 900f38b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
AfterTargets="ComputeRefAssembliesToPublish"
Condition="'$(MvcRazorCompileOnPublish)'=='true'">

<PropertyGroup>
<_MvcRazorOutputPdbFullPath>$([System.IO.Path]::ChangeExtension('$(_MvcRazorOutputFullPath)', '.pdb'))</_MvcRazorOutputPdbFullPath>
</PropertyGroup>

<ItemGroup>
<ResolvedFileToPublish
Remove="%(MvcRazorFilesToCompile.FullPath)"
Expand All @@ -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'">
Expand Down
14 changes: 14 additions & 0 deletions test/FunctionalTests/ViewCompilationOptionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ public async Task PublishingWithOption_AllowsPublishingRefAssemblies(RuntimeFlav
}
}

[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()
Expand Down

0 comments on commit 900f38b

Please sign in to comment.