MSBUILD configuration: copy output to staging area

Well, I'm not the best at MSBUILD. In fact, I do not know anything. I need help setting up my solution file to tell MSbuild to copy the compiled output to the staging area. The solution has about 35 projects. All I need is about 5 of them that need to be copied to an intermediate folder in release mode. Please assume that I do not know anything ...

thanks

+3
source share
1 answer

You can create a Target object that looks like this:

  <Target Name = "CopyFiles" DependsOnTargets = "YourBuildTargets">
    <CreateItem Include = "YourSolutionPath \ bin \ $ (Configuration) \ *. *">
      <Output ItemName="YourProjectOutputFiles" TaskParameter="Include"></Output>
    </CreateItem>

    <Copy SourceFiles="@(YourProjectOutputFiles)" DestinationFolder="$(DestinationFolder)"></Copy>
  </Target>

CopyFiles, YourBuildTargets ( , ). , (*. *) . Copy , , . , 1 MSBuild script, CreateItem node Copy node .

, , .csproj.

CopyFiles , script.

+5

Source: https://habr.com/ru/post/1721094/


All Articles