Search code examples
msbuild.net-coreappveyor

Appveyor CI fails to build a .net core 2.1 solution with a database project


Our .net core 2.1 solution compiles fine on our local development machines with .net core sdk 2.1.301. Appveyor used to compile the solution in its CI pipeline when there was no database projects defined. Once such a project added, Appveyor started failing in building the solution with the error message below. Any clues how to address this issue?

C:\projects\comingsoon\ComsingSoonDatabase\ComsingSoonDatabase.sqlproj(57,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.300\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.


Solution

  • The database project can only be built using the full framework MSBuild tools included in visual studio.

    Depending on how you set up appveyor, you need to change your definition to use msbuild.exe instead of dotnet commands.