Apply PublishProfile transformation in non-web projects

This was already implemented in 03b5df46c199e1a4f8abe158c1fdb5fdb9e2c84a (PR #85) but removed in 1c5c7ec38e440143dbd279cf1bfdad05c3b00fcf (issue #93) again.

This implementation additionally respects the case `$(Configuration) == $(PublishProfile)`.

Comments and suggestions for improvements welcome!