Question
Ultimately, we would like to use the command line to copy all files that csproj marked as Content , while maintaining the directory structure and without editing the source csprog file.
We have seen How to make MSBuild copy all files marked as Content to a folder while maintaining the folder structure? This does not work for us because it includes editing the csproj . We want to avoid this.
Msbuild?
We thought to use msbuild through the command line, but we do not know how to ask it to do only the equivalent of this:
<Target Name="CopyContentFiles"> <Copy SourceFiles="@(Content)" DestinationFiles="@(Content->'$(DestFolder)%(RelativeDir)%(Filename)%(Extension)')"/> </Target>
In other words, we would like to use the command line to determine the target (not just specify it) from the command line. For example. in pseudocode we want:
msbuild MyApp.csproj /t:"Copy SourceFiles="@(Content)" DestinationFiles=..."
XCopy?
We also thought about using xcopy , although we did not decide how to ask it to copy only files that have csproj tags as Content .
cmd msbuild csproj
Shaun luttin
source share