Goal: Run custom action after publishing SQL server database project in visual studio 2017
Problem: I have a SQL Server Database Project (.sqlproj) in the solution. In order to execute a customer action after publishing the project, the .sqlproj file is modified by adding a new target as shown below.
When I publish the project by right clicking on the project (or publish profile in the project) in visual studio IDE, it publishes the database project, but it does not execute this AfterPublish target.
Note: If I publish using MSBuild as shown below it successfully executes AfterPublish target.
msbuild mydbproj.sqlproj /t:build;publish /p:sqlpublishprofilepath=mydbproj.publish.xml