johnslaby
johnslaby

Reputation: 83

Cirrius.Mvvmcross.Community.Plugins.SQLite.WindowsStore needs platform-specific dlls for X86 and ARM

In order to create a Windows Store app that uses SQLite, it is necessary to create platform-specific variants (nominally X86 and ARM). The nuget package only provides the X86 version. To work around this, I have included the SQLite plugin projects in my solution, so when I change the target to ARM, it creates the appropriate ARM executables for all of the necessary projects. My question is, am I missing something in the use of the nuget package that would allow me to access the different DLLs, or is this a limitation of the nuget package?

Upvotes: 1

Views: 250

Answers (1)

Stuart
Stuart

Reputation: 66882

The nuget package does contain all 3 assemblies - but the nuspec nuget core doesn't understand the different assembly configurations. There are some powershell and .targets way around this - but not implemented by Mvx (yet).

There's some more info on this on https://nuget.codeplex.com/discussions/446656 and https://github.com/MvvmCross/MvvmCross/issues/307

While waiting for some hero to make a full solution, the workaround is to manually edit you .csproj file with conditionals like in https://nuget.codeplex.com/discussions/446656:

<Choose>
 <When Condition=" '$(Platform)' == 'ARM' ">
  <ItemGroup>
    <Reference Include="Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll">
      <HintPath>..\..\packages\...\x86\Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll</HintPath>
    </Reference>
  </ItemGroup>
 </When>
</Choose>
<Choose>
 <When Condition=" '$(Platform)' == 'x64' ">
  <ItemGroup>
    <Reference Include="Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll">
      <HintPath>..\..\packages\...\x64\Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll</HintPath>
    </Reference>
  </ItemGroup>
 </When>
</Choose>
<Choose>
 <When Condition=" '$(Platform)' == 'x86' ">
  <ItemGroup>
    <Reference Include="Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll">
      <HintPath>..\..\packages\...\x86\Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll</HintPath>
    </Reference>
  </ItemGroup>
 </When>
</Choose> 

Upvotes: 1

Related Questions