SQLitePCL.raw icon indicating copy to clipboard operation
SQLitePCL.raw copied to clipboard

Improve .targets files for .NET Framework

Open 0xced opened this issue 6 years ago • 1 comments

  • Simplify the .targets files by adding a new SQLiteNativeLibraries item. This also makes it easier if, for some reason, someone wants a reference to the native SQLite libraries in their MSBuild targets (fixes #301)
  • Add a condition on .NET Framework $(TargetFramework.StartsWith('net4')) because native library loading is handled automatically in .NET Core so we don't want to do extra work and risk to interfere with the .NET Core dll loading system
  • Use None instead of Content (thus removing Pack=false) and set Visible to false (fixes #156)

0xced avatar Oct 11 '19 14:10 0xced

Note that you should use '$(TargetFrameworkIdentifier)' == '.NETFramework' to test if you're building for the .NET Framework, and this will also work with the old project format.

Also, I didn't really review anything carefully here, but won't that line include all native libraries from all versions of the package that happen to be in the NuGet cache?

<SQLiteNativeLibraries Include="$(MSBuildThisFileDirectory)..\..\**\runtimes\win-*\native\libe_sqlcipher.dylib" />

I always use paths that start with $(MSBuildThisFileDirectory)\..\runtimes in my build scripts.

ltrzesniewski avatar Oct 15 '19 22:10 ltrzesniewski

Closing as outdated.

ericsink avatar Sep 19 '22 20:09 ericsink