CopySQLiteInteropFiles does not execute for unit test project

bill's Avatar

bill

01 May, 2015 03:24 PM

I have a solution with multiple projects that depend on SQLite. For most projects, the SQLite.Interop.dll files are copied to the target folder as expected:

[00:04:03] Done building target "AfterBuild" in project "Repository.Library.csproj".
[00:04:03] Target "CopySQLiteInteropFiles" in file "C:\projects\casereview\src\packages\System.Data.SQLite.Core.1.0.96.0\build\net45\System.Data.SQLite.Core.targets" from project "C:\projects\casereview\src\DataLayer\Repo.SQLite\Repository.Library.csproj" (target "B
[00:04:03] uild" depends on it):
[00:04:03] Building target "CopySQLiteInteropFiles" completely.
[00:04:03] Output file "bin\Debug\x64\SQLite.Interop.dll" does not exist.
[00:04:03] Output file "bin\Debug\x86\SQLite.Interop.dll" does not exist.
[00:04:03] Task "Copy"
...
[00:04:03] Done building target "CopySQLiteInteropFiles" in project "Repository.Library.csproj".
[00:04:03] Target "Build" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\projects\casereview\src\DataLayer\Repo.SQLite\Repository.Library.csproj" (entry point):
[00:04:03] Done building target "Build" in project "Repository.Library.csproj".

However, for the unit test project, this does not occur during the appveyor build. It just skips right past it with no output as to why:

[00:04:05] Done building target "AfterBuild" in project "CaseReview.SQLiteRepositoryTest.csproj".
[00:04:05] Target "Build" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\projects\casereview\src\TestCases\CaseReview.SQLiteRepositoryTest\CaseReview.SQLiteRepositoryTest.csproj" (entry point):
[00:04:05] Done building target "Build" in project "CaseReview.SQLiteRepositoryTest.csproj".

That seems to imply that it doesn't recognize that the unit test "Build" task depends on the CopySQLiteInteropFiles task, but I can't figure out why. I have a working project file and the failing unit test project file up in Beyond Compare, and I don't see any difference in the way the SQLite dependencies are referenced.

If I run the exact same msbuild command on my local machine using a clean clone of the repo, it executes the task.

Can anyone point me in the right direction here? Thanks!

  1. Support Staff 1 Posted by Feodor Fitsner on 01 May, 2015 04:22 PM

    Feodor Fitsner's Avatar

    Is it a public project?

    Most probably System.Data.SQLite.Core.targets does not yet exists when unit test compilation started. How/when do you restore NuGet packages? Try doing nuget restore in "Before build script" to have all dependencies ready before msbuild starts.

  2. 2 Posted by bill on 01 May, 2015 05:48 PM

    bill's Avatar

    Adding nuget restore worked! We have package restore enabled on the solution and it seemed to be restoring the packages enough to where everything would build, but somehow it was missing that task. Adding a nuget restore command on the solution before building did the trick.

    Thank you!

  3. Support Staff 3 Posted by Feodor Fitsner on 01 May, 2015 05:49 PM

    Feodor Fitsner's Avatar

    Good, thanks for the update!

    Take a look at this article: https://docs.nuget.org/consume/package-restore/migrating-to-automat...

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:56 AM.

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

Keyboard shortcuts

Generic

? 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