1

我正在使用 libsodium 0.10.0.0 包来实现密码散列。

安装 nuget 包后,将在 package.config 和项目文件中创建条目,如下所示:

 <Reference Include="Sodium, Version=0.10.0.0, Culture=neutral, processorArchitecture=MSIL">
      <HintPath>..\packages\libsodium-net.0.10.0\lib\Net40\Sodium.dll</HintPath>
  </Reference>   

构建后出现以下错误:

Severity    Code    Description Project File    Line    Suppression State
Error       Could not copy the file "C:\Projects\GIT\EP2\ep2-api.git\Applications\AMS\packages\runtimes\win-x86\native\libsodium.dll" because it was not found. Ace.Ams.Web     

为了解决上述错误,我在 csproj 文件中手动添加了以下配置设置,但仍然无法正常工作,然后我尝试手动将 libsodium 包路径中的“runtimes”文件夹复制到上述路径,它正在我的本地构建,但我的竹自动构建失败。

<ItemGroup> 
    <None Include="runtimes\win7-x86\native\**\*">
      <PackagePath>runtimes/win7-x86/native/</PackagePath>
      <Pack>true</Pack>
    </None>
    <None Include="runtimes\win7-x64\native\**\*">
      <PackagePath>runtimes/win7-x64/native/</PackagePath>
      <Pack>true</Pack>
    </None>
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFramework)' != 'net461'">
    <None Include="runtimes\osx-x64\native\**\*">
      <PackagePath>runtimes/osx-x64/native/</PackagePath>
      <Pack>true</Pack>
    </None>
    <None Include="runtimes\linux-x64\native\**\*">
      <PackagePath>runtimes/linux-x64/native/</PackagePath>
      <Pack>true</Pack>
    </None>
  </ItemGroup>
4

0 回答 0