in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Pinvoke DLL error with a twist

Last post 03-08-2010 2:06 PM by pendell. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-08-2010 9:18 AM

    Pinvoke DLL error with a twist

    I'm maintaining a legacy CE app.  I have in front of me both the compiled .CAB file and the C# source code in Microsoft Visual Studio 2008 which generates the .CAB file.  Both use SQLite to maintain a database.

     

    So I install the .CAB on a windows mobile platform. It and SQLite seem to work just fine. 

    Then I compile the source code and install the .CAB file on the mobile. Get the 'Can’t find PInvoke DLL error' when the app starts up.  Copy over the compact .DLL and the error goes away. 

    That would seem a reasonable solution -- except that the precompiled .CAB file doesn't need me to copy the DLL over to run SQLite. I checked. I re-installed the precompiled .CAB file and deleted the SQLITE .dll off the mobile. It still ran and created a SQLite database.

     Is there some kind of setting in visual studio I'm missing?   Why does the source code version require a DLL but the

    precompiled .CAB does not?  While I can probably get it to run anyway , it'd simplify installation to move only one  file.

     

    Respectfully,


    Brian P.  

     

  • 03-08-2010 2:06 PM In reply to

    Re: Pinvoke DLL error with a twist

    Problem solved. I added the following lines to the .csproj configuration file:

     

     <Content Include="SQLite.Interop.065.dll">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>

     Given that my .CAB file suddenly burgeoned to a 50% larger size, and given that the Pinvoke error went away, I conclude that the .DLL was included in the .CAB file.

     

    Respectfully,


    Brian P.

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems