System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
Overview

Artifact ID: f83758bc2f5844367b9fc4ea00fcaddb2b1dcdf4
Ticket: 5a35f3a26aea5204a768705816715f730efb8fd5
BadImageFormatException with SDK style .Net Framwork project
User & Date: anonymous 2019-11-04 14:36:55
Changes

  1. foundin changed to: "1.0.112"
  2. icomment:
    When using System.Data.SQLite in a .Net Framework project using the new SDK *.csproj file format a BadImageFormatException is triggered when opening a database connection.
    
    Build environment
    -----------------
    * Visual Studio 2019 (16.3.7)
    * SDK style *.csproj, TargetFramework "net472"
    
    A minimal example project will be attached.
    
    With .Net Framework projects the native interop files are placed in x86 and x64 subfolders in the build output directory, enabling SQLite to work when called from both 32 bit and 64 bit applications.
    
    When the new SDK style *.csproj format is used for a .Net Framwork project, a single *additional* interop is copied:
    During build the target "_CopyFilesMarkedCopyLocal" (verbose build output needed in Visual Studio to see this) the file "system.data.sqlite.core\1.0.112\runtimes\win-x86\native\netstandard2.0\SQLite.Interop.dll" is copied directly in the "\bin\Debug\net472" output folder. This file seems to have precedence over those in the x86 and x64 subfolders, triggering a BadImageFormatException when the application is started in 64bit mode.
    
    When this additional interop file is deleted from the output directory after the build, the application can be used without triggering the exception (no problem for deploy, but unpractical when debugging in VS).
    
    The problem does not exist with the legacy format for .Net Framework projects, or with the new format for .Net Core projects.
    
    I am aware that currently only legacy *.csproj files are officially supported. Therefore I am marking this as "Minor". See also a previous issue I had with a similar setup: [b2c278db3884e37e]
    
  3. login: "anonymous"
  4. mimetype: "text/x-fossil-plain"
  5. private_contact changed to: "85538d0325fff4d733bd2a239f2a74e2b0a2f841"
  6. severity changed to: "Minor"
  7. status changed to: "Open"
  8. title changed to:
    BadImageFormatException with SDK style .Net Framwork project
    
  9. type changed to: "Packaging"