locked
MSBUILD and master DACPAC RRS feed

  • Question

  • Which of the SSDT installation components from the Administrative install includes the master/msdb DACPAC files? I am building out a separate build server and installed the 64 bit components referenced by http://sqlproj.com/index.php/2012/03/headless-msbuild-support-for-ssdt-sqlproj-projects/ and the DACPACs did not install.

    Also, I am getting a weird issue when running the build from Cruise Control .NET in that it's looking for the master DACPAC in an odd place, prefixing the location of the build (sort of) to the path:

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(494,5): Build error SQL72027: File "C:\CCNetBuild\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\100\SqlSchemas\master.dacpac" does not exist. [C:\CCNetBuild\MyProject\Trunk\MyProject.Core\MyProject.Core.sqlproj

    Monday, May 14, 2012 8:34 PM

Answers

  • Hey Richard,

    Unfortunately, the system DACPACs (master and msdb) are not deployed by any of the components needed for setting up a headless build machine. They are only deployed by SSDT.msi, which is not one of the components required for a build server. We are working on plans to eliminate this problem and make sure that the system DACPACs are present in this case. There is a workaround, however, that you might want to try. Since the system DACPACs will not be at the location that is expected by the build task, you can set up your project ahead of time in a way that will enable you to have a succesful build.

    The main crux of the workaround is to copy the master.dacpac file from "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\xxx\SqlSchemas\master.dacpac" to your project directory and add it to your project via a 3-part-name reference. This can be done from the Add Database Reference dialog in your database project by choosing to add a "Different database, same server reference" dacpac reference which points at the local copy of master.dacpac. If you accept all of the default names, a reference to the local copy of master will be added to your project and you will still have full fidelity system element access as if you added a System database reference to master through the dialog. This should allow you to successfully build on a machine with SSDT installed and on a headless build machine without the full IDE.

    Let me know if this works for you or if you have any other questions!

    Thanks,

    Adam


    Adam Mahood - Program Manager Data-Tier Application Framework (DACFX)/SQL Server Data Tools

    Thursday, May 24, 2012 3:44 PM

All replies

  • Hey Richard,

    Unfortunately, the system DACPACs (master and msdb) are not deployed by any of the components needed for setting up a headless build machine. They are only deployed by SSDT.msi, which is not one of the components required for a build server. We are working on plans to eliminate this problem and make sure that the system DACPACs are present in this case. There is a workaround, however, that you might want to try. Since the system DACPACs will not be at the location that is expected by the build task, you can set up your project ahead of time in a way that will enable you to have a succesful build.

    The main crux of the workaround is to copy the master.dacpac file from "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\xxx\SqlSchemas\master.dacpac" to your project directory and add it to your project via a 3-part-name reference. This can be done from the Add Database Reference dialog in your database project by choosing to add a "Different database, same server reference" dacpac reference which points at the local copy of master.dacpac. If you accept all of the default names, a reference to the local copy of master will be added to your project and you will still have full fidelity system element access as if you added a System database reference to master through the dialog. This should allow you to successfully build on a machine with SSDT installed and on a headless build machine without the full IDE.

    Let me know if this works for you or if you have any other questions!

    Thanks,

    Adam


    Adam Mahood - Program Manager Data-Tier Application Framework (DACFX)/SQL Server Data Tools

    Thursday, May 24, 2012 3:44 PM
  • Worked for me.

    VS2012 database project  SQL2012.
    Build server TFS2010.

    Thursday, August 23, 2012 11:50 AM
  • "The main crux of the workaround is to copy the master.dacpac file from "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\xxx\SqlSchemas\master.dacpac" to your project directory "

    Hi Adam, 

    thanks for this workaround, it works.

    This is quite a similar workaround in comparison what we previously did in the former "database projects"... there we also added a local copy od the dbschema files of master and msdb to the projects. In this scenario we were even able to change them, we created a custom copy and removed all the not required stuff, so that only items / procedures that we used in our projects were left. This improved the compilation speed of our project a lot and is a common way you will find in a lot of articles about this. It looks like this is eigher not possible or not neccesary with SSDT projects... (the feels is quite fast though)

    But there is one other issue that just came up: You suggested to add the dacpac Files to the project. Imagine you have a solution with more than one sql server project included that all require some of the msdb / master functionality. In datqabase projects we were able to all a Solution Filter right under the solution File and we could add the dbschema files there and also put them under tfs source control. This seems to be impossible with dacpac files. You could add them to the solution, but you can't put them under source control, what looks weird to me...  WHY? So in this scenario, unfortunately we might have to add the datpac files to all of the projects within in the same solution instead of adding them ONCE to the solution and put the references to this location.

    Any tips or ideas on this?

    TY, Markus 

    Wednesday, August 29, 2012 4:22 PM