【发布时间】:2021-08-31 12:30:41
【问题描述】:
- 我创建了一个项目,该项目自动打包到 NuGet 包中并通过管道添加到 Azure Artifacts
- 我的 NuGet 包使用来自 nuget.org 的名为“TextFieldParserStandard”的库
- 我通过在 Visual Studio 中添加 Artifacts Feed 包源来安装我的 NuGet
- 我导入类并使用函数,但收到错误:
System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'TextFieldParserStandard, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
如果我在使用 NuGet 的项目中手动搜索并添加此库,我的 NuGet 可以正常工作。但它们应该自动出现。当我安装其他软件包时,我不需要手动安装它们的库。 所以问题是我的 NuGet 安装没有立即自动安装“TextFieldParserStandard”。
在 Artifacts Feed 中,我只有我的包“MyNuGet 版本 1.0.0.11538”。我不知道我的提要中是否应该有“TextFieldParserStandard”。 在 Visual Studio 中,管理 NuGetPackages,我的 NuGet 没有任何依赖项。
我的 NuGet SDK:.NET Standard 2.0(注意:与导入的项目兼容,因为如果我手动添加 TextFieldParserStandard,它就可以工作)。
如果需要,我可以提供 yaml 管道。这以某种方式解决了问题。 Build NuGet Package automatically including referenced dependencies
但是在yaml中添加IncludeReferencedProjects并没有解决。
【问题讨论】:
标签: c# .net azure-devops azure-pipelines nuget-package