-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
The Publish_NoBuild_CopiesStaticWebAssetsToDestinationFolder
currently fails with the following exception:
This occurs because .NET SDK has introduced a new target that throws an error if it finds items with any duplicate metadata ResolvedFileToPublish
.
I added this task to ensure that items in RazorGenerate
were removed from the ResolvedFileToPublish
list before the task below had a chance to run.
<Target
Name="_RazorRemoveGenerateBeforePublish"
BeforeTargets="_HandleFileConflictsForPublish"
Condition="'$(ResolvedRazorCompileToolset)'=='RazorSdk' and '$(RazorCompileOnPublish)'=='true'">
<ItemGroup Condition="'$(CopyRazorGenerateFilesToPublishDirectory)'=='false'">
<ResolvedFileToPublish Remove="@(RazorGenerate)"/>
</ItemGroup>
</Target>
This doesn't resolve the test failure in Publish_NoBuild_CopiesStaticWebAssetsToDestinationFolder. Upon further inspection, it appears that the RazorGenerate
ItemGroup associated with the publish step of this test is completely empty -- which means that the cshtml
files are never removed.
We should investigate:
- Why this test failure occurs only on this test and not others in the suite
- If there's a more reliable heuristic to use here
Addendum: with the code above the Publish_DoesNotPublishCustomRazorGenerateItems
passes which indicates that the issue is with the items not being populated into RazorGenerate
and not any issues with the _RazorRemoveGenerateBeforePublish
target.