34

Is there a full documentation about the csproj format for .net core projects?

I was looking for a way to copy files before building. After some searching I found a solution, but I can't find the documentation for this. Does it overwrite files? Are there extra options, ...

  <Target Name="CopyMyFiles" BeforeTargets="Build">
    <Copy SourceFiles="../../someFile.js" DestinationFolder="dest/" />
  </Target>

I found the additions for .net core here, but there is nothing about copy.
Does that mean copy is somehting from msbuild?
The target element is documented here But I don't find anything about copy. Is there a list of possible tasks somewhere?

Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217
roeland
  • 6,058
  • 7
  • 50
  • 67

1 Answers1

20

The documentation for the tasks included in MSBuild is here, with a page specifically on the copy task. Sadly, there are many features of the .NET SDK that aren't documented and probably only useful in special scenarios. I find myself looking at the source code of MSBuild, the .NET MSBuild SDK and the Web Sdk quite often to see how it is built and what can be done using it - e.g. while researching this answer.

Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217
  • Thanks. Here is the source of the Copy task. I'll take a look at it. https://github.com/Microsoft/msbuild/blob/master/src/Tasks/Copy.cs – roeland Jul 14 '17 at 07:45
  • Also see the [MSBuild project file schema reference](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-project-file-schema-reference?view=vs-2019). The root of the [MSBuild Reference](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-reference?view=vs-2019) documentation has links to other relevant documentation. – Adam Dingle May 16 '20 at 06:21