I have a app running on .NET 6.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
In this project I have dlls which I wanna copy from libraries folder files to output folder. I am using the below but its worrking,
<Target Name="AfterBuild" >
<ItemGroup>
<_CopyItems Include="Libraries\*.*" />
</ItemGroup>
<Copy SourceFiles="@(_CopyItems)" DestinationFolder="$(BuildOutput)" />
</Target>
Complete file is below,
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<Target Name="AfterBuild" >
<ItemGroup>
<_CopyItems Include="Libraries\*.*" />
</ItemGroup>
<Copy SourceFiles="@(_CopyItems)" DestinationFolder="$(BuildOutput)" />
</Target>
<ItemGroup>
<Reference Include="Lib">
<HintPath>Libraries\Lib.dll</HintPath>
</Reference>
</ItemGroup>
</Project>