Could not load file or assembly SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null

Original subject

In SQLLite-net-pcl 1.4.118 I have this error on UWP:

Could not load file or assembly 'SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference.

So, I have downgrade sqlite version to 1.3.3 : stack

But same error:

{System.IO.FileLoadException: Could not load file or assembly 'SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null'
   at GestionnaireCopropriete.Database.GCDatabase..ctor(String dbPath)
   at GestionnaireCopropriete.App.get_Database()
   at GestionnaireCopropriete.SettingsPage..ctor()}

I have clean. Closed and reopen. Delete /obj /bin... I don't understand why this problem is again her.

Tagged:

Best Answer

Answers

  • JohnHardmanJohnHardman GBUniversity mod
    edited November 2017

    @MaxenceSAUNIER -

    (1) Can you show the contents of your project.json for the UWP project?

    I cannot recall why, but sqlite-net-pcl in my UWP project is one of the very few NuGets where I use a beta version rather than the stable version. I have

        "sqlite-net-pcl": "1.5.166-beta",
    

    (2) If you open your UWP csproj in a text editor, do you have any reference to a sqlite-uwp vsix? If so, what does that line show? Do you have any other mentions of sqlite in that csproj file? If so, what are they?

    (3) Do you have SQLite for Universal Windows Platform installed in "Extensions and Updates" in Visual Studio? If so, what version?

  • MaxenceSAUNIERMaxenceSAUNIER USMember ✭✭✭
    1. project.json ? Where is it ?
    2. I don't have sqlite-uwp vsix but I have:

      <PackageReference Include="sqlite-net-pcl">
        <Version>1.3.3</Version>
      </PackageReference>
      
    3. Yes:

  • JohnHardmanJohnHardman GBUniversity mod

    @MaxenceSAUNIER - You might have packages.config rather than project.json

  • MaxenceSAUNIERMaxenceSAUNIER USMember ✭✭✭

    Package.appxmanifest:

    <?xml version="1.0" encoding="utf-8"?>
    <Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
      <Identity Name="6357ecdd-90e1-434d-aa44-02d453a98b97" Publisher="CN=latitude7480-maxence" Version="1.0.0.0" />
      <mp:PhoneIdentity PhoneProductId="6357ecdd-90e1-434d-aa44-02d453a98b97" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
      <Properties>
        <DisplayName>GestionnaireCopropriete.UWP</DisplayName>
        <PublisherDisplayName>latitude7480-maxence</PublisherDisplayName>
        <Logo>Assets\StoreLogo.png</Logo>
      </Properties>
      <Dependencies>
        <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
      </Dependencies>
      <Resources>
        <Resource Language="x-generate" />
      </Resources>
      <Applications>
        <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="GestionnaireCopropriete.UWP.App">
          <uap:VisualElements DisplayName="GestionnaireCopropriete.UWP" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="GestionnaireCopropriete.UWP" BackgroundColor="transparent">
            <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
            </uap:DefaultTile>
            <uap:SplashScreen Image="Assets\SplashScreen.png" />
            <uap:InitialRotationPreference>
              <uap:Rotation Preference="portrait" />
            </uap:InitialRotationPreference>
          </uap:VisualElements>
        </Application>
      </Applications>
      <Capabilities>
        <Capability Name="internetClient" />
        <uap:Capability Name="picturesLibrary" />
        <uap:Capability Name="videosLibrary" />
        <DeviceCapability Name="location" />
        <DeviceCapability Name="webcam" />
        <DeviceCapability Name="microphone" />
      </Capabilities>
    </Package>
    

    Project:

  • JohnHardmanJohnHardman GBUniversity mod

    @MaxenceSAUNIER - Make sure that you have this NuGet added to your UWP project (you might be able to use the latest stable, but I use the beta for this one):

  • MaxenceSAUNIERMaxenceSAUNIER USMember ✭✭✭
    edited November 2017

    In 1.3.3:

    Gravité Code    Description Projet  Fichier Ligne   État de la suppression
    Erreur      Impossible d’installer le package « System.Runtime.InteropServices.RuntimeInformation 4.0.0 ». Vous essayez d’installer ce package dans un projet ciblant « .NETPortable,Version=v4.5,Profile=Profile111 », mais le package ne contient aucun fichier de contenu ou référence d’assembly compatible avec ce framework. Pour plus d’informations, contactez le créateur du package.          0   
    

    In 1.5 it work for UWP but for iOS I have this issue:

    Gravité Code    Description Projet  Fichier Ligne   État de la suppression
    Erreur      No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com.   GestionnaireCopropriete.iOS         
    

    My certificate is good and it work in 1.4 SQLite-net-pcl

  • MaxenceSAUNIERMaxenceSAUNIER USMember ✭✭✭

    Oh no, it's my fault. Apple Development contract have expired today. Thanks for your help. It work.

  • AMD21AMD21 USMember ✭✭

    @JohnHardman Thanks a lot!

Sign In or Register to comment.