Helper method to spawn a process and run 'dotnet publish'.
Path to project file (like .csproj) or directory of project to build
Build configuration, such as 'Release'
The relative or absolute path for the build output
Optional
Optionally run the command from another current working directory
Helper method to spawn a process and run 'dotnet publish'.