C#/WPF

[WPF] Build 시 폴더 OutDir 복사

딸기우유중독 2024. 10. 29. 14:49



..\Executes 폴더 안의 폴더를 실행 파일 폴더의 Executes 폴더로 복사

<ItemGroup>
	<None Include="..\Executes\**\*.*" CopyToOutputDirectory="PreserveNewest"  Link="Executes\%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

 

 

 

 

 

 


 

https://github.com/dotnet/msbuild/issues/2795

 

Allow CopyToOutputDirectory to have a custom destination path · Issue #2795 · dotnet/msbuild

The destination of CopyToOutputDirectory attribute in msbuild is fixed, there are various questions about how to change the destination path: https://stackoverflow.com/questions/10204370/can-i-spec...

github.com

 

 


 


..\Execute 폴더 안의 폴더를 실행 파일 폴더로 복사

<Project Sdk="Microsoft.NET.Sdk">
  <ItemGroup>
    <Content Include="..\Execute\**\*.*"">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
</Project>

 


 

https://stackoverflow.com/questions/44374074/copy-files-to-output-directory-using-csproj-dotnetcore

 

Copy files to output directory using csproj dotnetcore

So my issue is pretty simple. I have some files that I want to be copied to the build output directory whether it is a debug build or a release publish. All of the information I can find is about t...

stackoverflow.com

 

728x90