admin管理员组

文章数量:1279110

My solution is a .NET 8 project for a Raspberry Pi. I can publish to a local directory with the arm-64 architecture. Then in the developer console I can use the scp command to copy the publish directory to the Raspberry Pi. Again project builds and publishes fine, copying manually to the Pi works fine.

My goal is to just have VS (2022 pro) perform the scp command after the publish completes. I tried updating my publish profile pubxml to add the target:

<Project>
...
<Target Name="ScpPublishedFilesToPiDevice" AfterTargets="Publish">
    <Message Importance="High"  Text="starting after publish target" />
    <Exec Command="echo -- copying published files to Pi ---" />
    <Exec Command="start c:\windows\system32\scp.exe -r -i c:\users\MyUser\.ssh\id_ed25519 ./PiApp/bin/Release/net8.0/publish/*.* user@ipaddress:~/PiApp/" />
</Target>
</Project>

The message line and first exec line with echo are there for testing to see if those are even being hit. I don't see any message or echo in the output window.

Any ideas how to get the after publish target to fire?

本文标签: raspberry piVisual Studio fails to execute after publish targetStack Overflow