.net core 2.1 build fails after adding a database project

Arash Sabet's Avatar

Arash Sabet

03 Jul, 2018 03:06 AM

After adding a SQL Server project to the solution that was compiling fine, the build started failing consistently due to the failure message below. Any suggestion on fixing this problem is appreciated. Thanks.

Build started
git clone -q --branch=develop https://github.com/Umplify/ComingSoon.git C:\projects\comingsoon
git checkout -qf b86f1ecee6316f67d19b1c00dbe24cc1b6183ad7
dotnet restore
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 <Import> declaration is correct, and that the file exists on disk.
Command exited with code 1

  1. Support Staff 1 Posted by Ilya Finkelshte... on 03 Jul, 2018 03:47 AM

    Ilya Finkelshteyn's Avatar

    Is dotnet restore works for you locally? And if yes, what .NET Core SDK is installed locally? It seems like issue described here.

  2. 2 Posted by Arash Sabet on 03 Jul, 2018 03:55 AM

    Arash Sabet's Avatar

    Yes, it always works locally for me with .net core sdk v2.1.301.

  3. 3 Posted by Arash Sabet on 03 Jul, 2018 11:38 AM

    Arash Sabet's Avatar

    I think some changes/fixes should take place in your build servers like installing the new SDK, etc. I don't think if I can do much by altering the build definition.

  4. Support Staff 4 Posted by Ilya Finkelshte... on 04 Jul, 2018 12:54 AM

    Ilya Finkelshteyn's Avatar

    I see that you fixed that using Martin's advise. It never hurts to update the forum thread though so other people can benefit from it.

  5. 5 Posted by Arash Sabet on 04 Jul, 2018 01:45 PM

    Arash Sabet's Avatar

    Indeed. The fix took place by including the following two steps in the yml file:

    msbuild /t:restore PathToTheSolutionFile
    msbuild /t:build PathToTheSolutionFile

  6. Support Staff 6 Posted by Ilya Finkelshte... on 04 Jul, 2018 05:19 PM

    Ilya Finkelshteyn's Avatar

    Thanks. However I do not think that msbuild /t:build is pessary. msbuild /t:restore can be called as before_build script, and then AppVeyor will execute correct build command automatically (provided build_script does not exist). This is useful if you for example need automatic nuget packaging.

  7. 7 Posted by Arash Sabet on 04 Jul, 2018 09:40 PM

    Arash Sabet's Avatar

    Done! and it works.

  8. Owen McDonnell closed this discussion on 27 Aug, 2018 06:40 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac