7

I am getting this error

The imported project "C:\Program Files\dotnet\sdk\6.0.101\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\6.0.101\\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" is correct, and that the file exists on disk.

when running E2E test which will create the database using DACPAC. I am using this command to run my e2e test project

dotnet test "%workspace%\test\SampleProjectE2E\SampleProjectE2E.csproj"

I have checked in google. The answer I got is to install SSDT in build server. Not sure this will work or not. Please help.

Raja Kondla
  • 278
  • 3
  • 11

1 Answers1

2

Microsoft.Data.Tools.Schema.SqlTasks.targets are required to build a SQL database project from the command line

Required dependencies are available as Nuget package and just install in build server using the below command

dotnet add package Microsoft.NETFramework.ReferenceAssemblies --version 1.0.2

Arun
  • 62
  • 4
  • 1
    This gives me error of `Unable to create dependency graph file for project 'mydatabase.sqlproj'. Cannot add package reference.` Am i running it in the wrong place? – LPQ Jul 28 '22 at 10:09
  • 1
    I get this error: C:\Users\phammant\.nuget\packages\microsoft.build.sql\0.1.3-preview\Sdk\Sdk.targets(12,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\6.0.302\Microsoft\VisualStudio\v16.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. – paul_h Aug 22 '22 at 10:54