Using VS 2022 17.12.13, but this occurred in an earlier 2022 version, not sure which. Did a clean install trying to fix this.
My setup may be rare, I have only the “.NET desktop development” workload installed.
When trying to publish to a folder using the "Folder" option, the process fails silently. VS says “Publish succeeded” but no files are created.
When trying to publish to a folder using the "ClickOnce" option, get this error message, and no files are created: Could not find a part of the path 'D:\Dev\xxxx\bin\Release\net8.0-windows\app.publish'.
Workaround: I tried everything mentioned here and many other posts, no help. Finally tried adding the “Windows application development” workload. Making no other changes, tried publishing the original project again. Success!
Later, I removed the “Windows application development” workload. Publishing still works. Perhaps VS tracks workload components like Windows tracks dlls, and didn't remove publishing since it is (should be) part of the original workload.