0

I need to write a visual studio add in targeting visual studio 2012, which will retrieve SSDT project properties which are configured in a SSDT project.

Some properties can be retrieved by the below code snippet.

_applicationObject.Solution.Projects.Item(1).ConfigurationManager.ActiveConfiguration;

But i'm interested in the Advanced deployment settings which are appearing on the debug section of the project properties.

Any help will be highly appreciated.

Regards, Zehan

  • Can you give an example of the settings you want? – Ed Elliott Feb 13 '17 at 06:56
  • for example i need the Target connection string in the debug tab – Zehan Jurangpathy Feb 13 '17 at 08:08
  • Update : I found that publish database option allows to create a profile for the publish. When saving the profile, visual studio created a pusblish.xml file which contained the settings which I want. I can read the xml file now. But it would be nice if there was any API to read the file and also modify it? – Zehan Jurangpathy Feb 13 '17 at 09:18
  • ah not that I know of, all the settings are here though https://msdn.microsoft.com/en-us/library/hh550080.aspx (or google "sqlpackage.exe command line syntax" - see the section "Properties specific to the Publish action" – Ed Elliott Feb 13 '17 at 09:55

1 Answers1

0

I found the solution to my problem.

SSDT tools for VS 2012 gives the developer an option to create a publish profile. This can be found at right click on the solution and publish. The developer can set all the necessary settings that are needed to publish the database. Once set, the developer can save the settings into a publish profile. The profile is created as databaseProjectName.publish.xml in the solution folder. The advanced deployment settings too are saved in this file.

To publish the .dacpac file with the publish profile, we can use the API provided in the DacServices class found in the Microsoft.SqlServer.Dac Namespace.