Hosted VS2017 agent build master.dacpac does not exist

My solution, built with VS2017 Professional, contains a SQL Server database project that references the main database. When using Hosted VS2017 Agent to build my solution in Visual Studio Team Services I get the following errors:

2017-07-14T12: 44: 17.8387743Z ## [error] C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Enterprise \ MSBuild \ Microsoft \ VisualStudio \ v15.0 \ SSDT \ Microsoft.Data.Tools. Schema.SqlTasks.targets (559.5): Error SQL72027: File "C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Professional \ Common7 \ IDE \ Extensions \ Microsoft \ SQLdb in Lazarus \ Extensions \ SqlServer \ 110 \ SqlSchemas \ master.dacpac "does not exist. 2017-07-14T12: 44: 17.8397816ZC: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Enterprise \ MSBuild \ Microsoft \ VisualStudio \ v15.0 \ SSDT \ Microsoft.Data.Tools.Schema.SqlTasks.targets ( 559.5): Build error SQL72027: File "C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Professional \ Common7 \ IDE \ Extensions \ Microsoft \ SQLdb in Lazarus \ Extensions \ SqlServer \ 110 \ SqlSchemas \ master. dacpac "does not exist. [D: \ a \ 3 \ s \ Home \ ItAsset.Database \ ItAsset.Database.sqlproj]

How can I fix this and get a build solution in VSTS?

+22


source to share


4 answers


I just figured it out in a multi developer situation. This is similar to VS2017 SSDT projects where the developer who first checked the code had Visual Studio installed in a different path than you or a different instance of Visual Studio. For example, if developer A is set by default to C: \, but developer B has installed his VS2017 to drive E: \, whoever creates the link to Master will work, the other won't find the dacpac file.

In the .sqlproj file, you will most likely find this link in the Master database:

 <ArtifactReference Include="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">
  <HintPath>$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac</HintPath>

      



Note: <HintPath>

Valid but Include="

hardcoded path. It seems that the hint path is not being followed as usual. To fix the problem, try copying the contents of the HintPath element into the Include attribute. Leave HintPath as it is.

<ArtifactReference Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">

      

+46


source


This is a bug in SSDT for Visual Studio 2017.

The workaround is to manually edit the project file by replacing the full path with the $ (DacPacRootPath) variable. Or you can use SSDT for Visual Studio 2015.



https://feedback.azure.com/forums/908035-sql-server/suggestions/32897047-visual-studio-2017-ssdt-adds-hardcoded-master-dacp#comments

12/8/2019 Update - This bug has been fixed in Visual Studio 2019 and Visual Studio 2017 version 15.9.13. Take a look here - https://developercommunity.visualstudio.com/content/problem/124214/visual-studio-2017-ssdt-adds-hardcoded-mmsdb-andor.html

+16


source


It uses an absolute path that doesn't exist in Hosted VS2017 Agent. ( Professional vs Enterprise ). You can check your project file (open sqlproj file through nodepad)

You can copy the master.dacpac file to your project folder and include it in your project, and then add a link to that file.

+3


source


Trying to open SSDT in VS2019 that was created in VS2017 requires a change

From:

<ArtifactReference Include="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">

      

To:

<ArtifactReference Include="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SQLSchemas\master.dacpac">

      

NOTE: Enterprise Visual Studio

-1


source







All Articles