PostDeployment script is not included
-
2012年7月9日 下午 10:50
Post deploy script is not included during publish WHEN dacpac is referenced as the same database and the project name is the same as referenced dacpac. Looks like SSDT is using the postDeploy from dacpac project or something.
Let me know if anyone has the same issue.
所有回覆
-
2012年7月10日 下午 02:08I've got the same issue. I assume you are using the "IncludeCompositeObjects" setting to include the tables/views/etc from the referenced DACPAC. Unfortunately, objects only included model objects, not pre and post deploy scripts.
- 已提議為解答 Janet YeildingMicrosoft Employee, Owner 2012年7月10日 下午 05:33
- 已取消提議為解答 Janet YeildingMicrosoft Employee, Owner 2012年7月10日 下午 07:41
-
2012年7月10日 下午 06:00
Richard, just to clarify, the postdeploy is included from the referenced dacpac and is not included from the project which has the reference, like it is being overwritten by the included dacpac. And that happens only when Project name (not target database) and the Dacpac reference has the same name.
-
2012年7月10日 下午 08:12擁有者
Hi leff_f,
I've tried to reproduce the behavior you're seeing by doing the following, but I'm not able to. Are there any missing steps? Please let me know, below is what I did to try to reproduce what you described:
1. Create a new database project PostDeployRepro
2. Add a post-deployment script to PostDeployRepro with the following: "Select 1"
3. Snapshot PostDeployRepro
4. Create another database project PostDeployRepro in a solution of a different name
5. Add a database reference to the snapshot .dacpac and set the reference as "same database"
6. Add a post-deployment script to this project with the following: "Select 2"
7. Verify that "Include Composite Projects" is specified in Advanced Publish options
8. Generate a publish script for this project
Result: publish script contained "Select 2" instead of "Select 1" at the end of the script, meaning that the post deployment script from the project, not the referenced .dacpac was used.
- 已提議為解答 Adam Mahood [MSFT]Microsoft Employee, Owner 2012年7月16日 下午 02:49
- 已標示為解答 Janet YeildingMicrosoft Employee, Owner 2012年7月16日 下午 07:01
-
2013年5月9日 下午 01:51
I think much cooler it would be if select 1 and select 2 were included in final script.
this way I could in my base dacpac include dictionary table inserts and in second project override dictionary values if needed.
it should be the same behavior when I deploy dacpac directly or when I reference it
this is meaning of word reference, is a pointer to sometihng, not some funky logic what is using only DDL
if we have had reference this way c# it would be awkward, wouldn't be?
MaciejW
- 已編輯 Maciej_W 2013年5月9日 下午 01:53

