Copy content files during assembly using Visual Studio Code

I am working on a C # project with content files. In MonoDevelop, I can set the Content and Build Action to Copy if Newer . I can do something like this in Visual Studio.

How to do this with Visual Studio Code? I do not open the solution file (I open the directory) and I see nothing in tasks.json or in VSCode, which I can use to configure it.

+6
source share
2 answers

Try manipulating csproj:

  <ItemGroup> <None Update="FILE_PATH"> <CopyToOutputDirectory>ACTION_TYPE</CopyToOutputDirectory> </None> </ItemGroup> 
  • FILE_PATH is a relative path inside your project, for example. "Nlog.config".
  • ACTION_TYPE - There are two possible options: PreserveNewest (copy, if never), and Always
+3
source

Updating the .csproj file with the line of code below helped me

  <Content Include="FolderPath/*"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> 
0
source

All Articles