question

lavanyadeepak avatar image
0 Votes"
lavanyadeepak asked DylanZhu-MSFT answered

MSBuild Copy Goes To A Different (Incorrect) Location

I have the following in my .CSPROJ file

<Target Name="PostPublish" BeforeTargets="MSDeployPublish">
<Exec WorkingDirectory="$(MSBuildProjectDirectory)"
Command='robocopy $(MSBuildProjectDirectory)\Love $(PublishDir)\Love /S /COPY:DATS /NP /NFL /NDL /v' ContinueOnError="true" />
</Target>

Now the folder Love in Web Project is going to bin\app.publish instead of the Web Deploy location. Is there a different variable for Web Deploy location other than $(PublishDir) or should I use this in a different event other than BeforeTargets?

vs-msbuild
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DylanZhu-MSFT avatar image
0 Votes"
DylanZhu-MSFT answered

Hi lavanyadeepak,

You need to confirm if the PublishDir is the specified path in your csproj file. And maybe you can create a <DotNetPublishFiles> to publish the files to your specified directory.

Best Regards,
Dylan


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.