【问题标题】:Unable to reference dll included in a Nuget Package无法引用 Nuget 包中包含的 dll
【发布时间】:2019-04-30 00:58:00
【问题描述】:

我遇到了一个奇怪的问题,我无法引用 nuget 包中包含的 dll。

奇怪的是,使用这个包的其他人都能够引用这个 dll 并使用其中的类。

我的 Visual Studio 中是否有某些设置可能会阻止这种情况?

我可以通过解决方案资源管理器视图查看包含在此 nuget 包中的 dll...

提前致谢!

++ 为项目提供更多细节 我们在项目中没有 package.config 文件。 这是一个netcoreapp2.1项目

我们通过

引用包
<PackageReference Include="Microsoft.MarketplaceServices.CatalogOrchestrator.EventPublishers.AzureFunctions" Version="1.1.0" />

在 .csproj 文件中

dll是通过csproj中下面一行通过包引用的

<ProjectReference Include="..\EventPublishers.Common\EventPublishers.Common.csproj" PrivateAssets="All" />

【问题讨论】:

  • 什么样的项目?如果使用packages.config,那会是什么样子?否则项目文件是什么样的? (请更新问题。)
  • @Richard 我在问题中提供了更多信息!
  • 这个 NuGet 包在哪里? Microsoft.MarketplaceServices.CatalogOrchestrator.EventPublishers.AzureFunctions 不在 NuGet.org。

标签: .net visual-studio nuget-package visual-studio-2019 dll-reference


【解决方案1】:

实际上,清理本地 nuget 缓存并重新安装软件包解决了这个问题...哈哈

使用以下命令通过 nuget 包管理器清理本地 nuget 缓存:

nuget locals all -list

【讨论】:

    猜你喜欢
    • 2016-04-16
    • 2014-07-16
    • 1970-01-01
    • 1970-01-01
    • 2019-10-11
    • 1970-01-01
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多