Search code examples
asp.net-mvcsqliteteamcityoctopus-deploy

SQLite.Interop.dll not getting picked up by OctoPack


I've got a relatively new MVC5 project being built with TeamCity and deployed by Octopus Deploy. Everything was great until I added SQLite through NuGet. When the project gets built, I get an x86\SQLite.Interop.dll and an x64\SQLite.Interop.dll under my bin directory and it runs fine.

The problem is that OctoPack doesn't pick up either file; so, my NuGet package that I deploy to my server doesn't have it. How does one fix this?


Solution

  • The fine folks at Octopus Deploy pointed me to this help page that got me most of the way there.

    For anyone else who runs into this particular problem, I originally added this to my .nuspec file:

    <files>
        <file src="bin\x86\*.*" target="bin\x86" />
        <file src="bin\x64\*.*" target="bin\x64" />
    </files>
    

    but nothing got copied; so, I changed it to this:

    <files>
        <file src="bin\x86\SQLite.interop.dll" target="bin\x86" />
        <file src="bin\x64\SQLite.interop.dll" target="bin\x64" />
    </files>
    

    Then TeamCity had a build error because x86 and x64 were empty. It looks like OctoPack somehow runs before those files get copied. It's a hack that I hope to remove at some point, but I got things working by adding those two files to my project, and changing my nuspec file to this:

    <files>
        <file src="SQLiteFiles\x86\SQLite.interop.dll" target="bin\x86" />
        <file src="SQLiteFiles\x64\SQLite.interop.dll" target="bin\x64" />
    </files>
    

    Also, don't forget to add OctoPackEnforceAddingFiles=true in TeamCity.