peterhuene / sqlite-net-wp8

A C++/CX wrapper for SQLite functions that sqlite-net depends on. Can be used as an alternative to csharp-sqlite on Windows Phone 8. This library is released under the MIT license.
MIT License
74 stars 65 forks source link

Improve multiplatform support for visual studio #29

Closed jagui closed 10 years ago

jagui commented 10 years ago

Hi Peter, I'm working with the 3.8.3 version of your nuget package and I'm having problems when switching from ARM to x86 platform in visual studio.

Actually that totally makes if you look at the reference that was added to the csproj:

<Reference Include="Sqlite, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
    <SpecificVersion>False</SpecificVersion>
    <HintPath>..\..\mywp8solution\packages\sqlite-net-wp8.3.8.3\lib\windowsphone8\Sqlite.winmd</HintPath>
</Reference>

I fixed this by manually editing the reference to

    <HintPath>..\..\mywp8solution\packages\sqlite-net-wp8.3.8.3\build\$(Platform)\windowsphone8

hence supporting both x86 and ARM targets.

Do you think the package could be upgraded for automatically supporting this scenario w/o manually editing the csproj?

Thanks, Juan

peterhuene commented 10 years ago

I'll take a look at it tonight after work (I'm UTC-8:00). I no longer actively do any WP8 development, so I don't always catch things like this. I'll try to improve the experience so that the NuGet package is easier to use.

peterhuene commented 10 years ago

So I took a look at this issue and I can't seem to reproduce the problem.

When I create a new WP8 solution, add the sqlite-net-wp8 NuGet package, add my fork of the sqlite-net sources, and define USE_WP8_NATIVE_SQLITE, everything builds correctly for ARM and x64 (AnyCPU isn't supported).

The referenced NuGet package causes this import in the project file: <Import Project="..\packages\sqlite-net-wp8.3.8.3\build\windowsphone8\sqlite-net-wp8.targets" Condition="Exists('..\packages\sqlite-net-wp8.3.8.3\build\windowsphone8\sqlite-net-wp8.targets')" />

Inside this, there's a reference to Sqlite.winmd with this hint path: <HintPath>$(MSBuildThisFileDirectory)$(Platform)\Sqlite.winmd</HintPath>

Indeed, the reference changes when the active solution platform changes. I can see in the properties window with the Sqlite reference selected that the Path property contains with ARM or x86.

Could you provide me with repro steps so that I can see the problem you're having? Thanks.

jagui commented 10 years ago

Turns out there were some wrong references in my csproj. After cleaning the mess it works like a charm.

Sorry for the incovenience and thanks for taking some time trying to repro.