Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@
</ItemGroup>

<GenerateMvcTestManifestTask ManifestPath="$(PublishDir)MvcTestingAppManifest.json" Projects="@(_PublishManifestProjects)" />
<Copy SourceFiles="%(_DepsFileToPublish.FullPath)" DestinationFolder="$(PublishDir)" Condition="Exists('%(_DepsFileToPublish.FullPath)')" />

<ItemGroup>
<_DepsFilesToPublishResolved Include="%(_DepsFileToPublish.FullPath)" Condition="Exists('%(_DepsFileToPublish.FullPath)')" />
</ItemGroup>

<Copy SourceFiles="@(_DepsFilesToPublishResolved)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" Condition="@(_DepsFilesToPublishResolved->Count()) > 0" />
Comment on lines +60 to +63
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition Exists('%(_DepsFileToPublish.FullPath)') is evaluated for each item in the batching operation. Consider moving the existence check to the Copy task condition or using a different approach to avoid repeated file system calls during item transformation.

Suggested change
<_DepsFilesToPublishResolved Include="%(_DepsFileToPublish.FullPath)" Condition="Exists('%(_DepsFileToPublish.FullPath)')" />
</ItemGroup>
<Copy SourceFiles="@(_DepsFilesToPublishResolved)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" Condition="@(_DepsFilesToPublishResolved->Count()) > 0" />
<_DepsFilesToPublishResolved Include="%(_DepsFileToPublish.FullPath)" />
</ItemGroup>
<Copy SourceFiles="@(_DepsFilesToPublishResolved)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" Condition="@(_DepsFilesToPublishResolved->Count()) > 0 and %(_DepsFilesToPublishResolved.Exists)" />

Copilot uses AI. Check for mistakes.

</Target>

<Target Name="_MvcCopyDependencyFiles" AfterTargets="Build;_ResolveMvcTestProjectReferences" Condition="'$(TargetFramework)'!=''">
Expand All @@ -70,11 +75,16 @@
<_CreateSymbolicLinksForMvcCopyDependencyFilesIfPossible Condition="'$(_CreateSymbolicLinksMvcCopyDependencyFilesIfPossible)' == ''">$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)</_CreateSymbolicLinksForMvcCopyDependencyFilesIfPossible>
</PropertyGroup>

<Copy SourceFiles="%(DepsFilePaths.FullPath)"
<ItemGroup>
<_DepsFilesToCopy Include="@(DepsFilePaths)" Condition="Exists('%(DepsFilePaths.FullPath)')" />
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the previous comment, the condition Exists('%(DepsFilePaths.FullPath)') performs file system checks during item transformation. This could impact performance when there are many dependency files. Consider handling non-existent files in the Copy task itself.

Suggested change
<_DepsFilesToCopy Include="@(DepsFilePaths)" Condition="Exists('%(DepsFilePaths.FullPath)')" />
<_DepsFilesToCopy Include="@(DepsFilePaths)" />

Copilot uses AI. Check for mistakes.

</ItemGroup>

<Copy SourceFiles="@(_DepsFilesToCopy)"
DestinationFolder="$(OutDir)"
UseHardlinksIfPossible="$(_CreateHardLinksForMvcCopyDependencyFilesIfPossible)"
UseSymboliclinksIfPossible="$(_CreateSymbolicLinksForMvcCopyDependencyFilesIfPossible)"
Condition="Exists('%(DepsFilePaths.FullPath)')" />
SkipUnchangedFiles="true"
Condition="@(_DepsFilesToCopy->Count()) > 0" />
</Target>

</Project>
Loading