You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装NuGet包DirectCelik时.NET Framework项目添加引用失败求助

安装NuGet包DirectCelik时在.NET Framework项目中遇非托管DLL引用错误

从NuGet.org安装自制包DirectCelik时,出现如下错误:

Failed to add reference to 'XYZ', please make sure that the file is accessible, and that it is a valid assembly or COM component.

错误中的XYZ是随包分发的非托管DLL CelikApi32(同包的CelikApi64暂未出现报错),且该错误无NU5100这类官方错误代码。

问题触发特征

  • 仅在目标框架为.NET Framework 3.5/4.6的项目中出现,.NET 8项目完全正常
  • 该NuGet包本身以.NET Framework 3.5为目标框架

当前临时解决办法

手动在.csproj文件中添加以下代码可绕过问题:

<PackageReference Include="DirectCelik" Version="1.0.1" />

但此方法不适用于公共包的长期维护,寻求根本解决方案。

内容的提问来源于stack exchange,提问作者DeltaJuliet2k

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 02:04:54