Nov 26 2021
02:58 AM
- last edited on
Mar 05 2024
01:21 PM
by
TechCommunityAP
Nov 26 2021
02:58 AM
- last edited on
Mar 05 2024
01:21 PM
by
TechCommunityAP
I have a sql database project in Visual Studio (2019). I am trying to deploy it via azure devops.
The pipeline is failing due to the below error:
##[error]C:\azagent\A1_work\r1\a_Transcripts-SQLDeployment\SampleDatabaseProject\SampleDatabaseProject\
SampleDatabaseProject.sqlproj(117,3): Error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.
Data.Tools.Schema.SqlTasks.targets" was not found.
Confirm that the path in the declaration is correct, and that the file exists on disk
The project builds without issue on my pc. In the pipeline I have tried both the MSBuild and Visual Studio Build tasks, but the result is the same in each case.
In the sqlproj file xml, i can see reference to ssdt, but I'm not sure what to alter here to allow this to build in azure devops:
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\
Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion> </PropertyGroup>
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" /> <ItemGroup>
Its clear that MSBuild in azure devops cannot see the ssdt dll's, but i dont know how to resolve this problem.
Appreciate any advice.
Dec 01 2021 04:48 AM
Hello @wilson_smyth I have the same problem, Did you resolve it?
Dec 01 2021 09:11 AM
@sebasmoreno14
Hi.
I didnt find an exact fix, but i got round the issue.
instead of doing the build in the release pipeline i do it in the build pipeline. for some reason it works without issue in there.
Dec 01 2021 02:04 PM
Hi !@wilson_smyth Thanks very much for the reply.
After fight a little bit with all this problem I could resolve it with the next steps (I hope it helps someone):
2. In my release Pipeline I put one task of type Azure SQL DacpacTask, in this task you have to configure the target database the .dacpac file (generate in the build - step 1.)