Hey @catmanjan
We did circle with the team internally; and the build process is working as expected. The <Target />
definitions you defined are evaluated by MSBuild as part of a core process and publish steps, i.e. <DockerPublish/>
are executed post the core step. The way to think of it, VS:
- Pre: verify pre-requisites
- Core: build (projects, images) and execute targets
- Post: push the image
That's why you're seeing this type of experience. The VS IDE isn't suitable for this type of customizable build. Having a CI/CD pipeline would be the best preferable option, but I know you've stated using the IDE for your build and publish.
To that end, the only way I know of to get around this is separating your build and publish into two or more different proj files. You'll want one to reference the project being built and have those artifacts saved to a destination folder and pushed and a second one to execute your kubectl commands.
Feel free though pass feedback to the team about this issue. The team will capture the feedback and evaluate it. You can always submit feedback and issues through the Visual Studio IDE; see Report a problem with Visual Studio - Visual Studio (Windows) | Microsoft Learn.