0

I have a problem with SQLite.Interop.dll library. I am required to use x64 and x86 distribution of it. I also need both of them to be copied into output directory in

x64/SQLite.Interop.dll

and

x86/SQLite.Interop.dll

folders respectively.

I created a Nuget package with following nuspec file:

<?xml version="1.0"?>
<package >
  <metadata minClientVersion="2.5">
    <id>SQLite.Interop</id>
    <version>1.1.18</version>
    <authors>SQLite</authors>
    <owners>That's me</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>That's for me.</description>
    <copyright>Copyright 2018</copyright>
    <tags>SQLite Interop ofcMe</tags>
    <dependencies>
    </dependencies>
  </metadata>
    <files>
        <file src="content\x86\SQLite.Interop.dll" target="content\x86\SQLite.Interop.dll" />
        <file src="content\x64\SQLite.Interop.dll" target="content\x64\SQLite.Interop.dll" />
        <file src="bin\Debug\x64\SQLite.Interop.dll" target="Build\x64\" />
        <file src="bin\Debug\x86\SQLite.Interop.dll" target="Build\x86\" />
        <file src="SQLite.Interop.targets" target="Build\" />
    </files>
</package>

And following SQLite.Interop.targets file:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <None Include="@(MSBuildThisFileDirectory)x64\SQLite.Interop.dll">
      <Link>SQLite.Interop.dll</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Include="@(MSBuildThisFileDirectory)x86\SQLite.Interop.dll">
      <Link>SQLite.Interop.dll</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
</Project>

How to archive this after application builds?

4

1 回答 1

0

我在其输出目录中添加了对需要 SQLite.Interop 的项目的 SQLite.Core 引用,因为它的 nuget 包中有必要的脚本。

我知道这是一种解决方法,但它以少量、小尺寸的库参考为代价解决了我的问题。

于 2018-12-06T06:19:15.947 回答