nuget - Azure DevOps,使用 website.sln 文件时为“Visual Studio Build”恢复 NuGet 包
问题描述
我似乎无法为我的 DevOps 构建管道找到正确的设置,以使其能够恢复 NuGet 包,以便构建过程能够找到它们。
我遇到的第一个问题是默认设置将还原指向我的 .sln 文件,导致它打印出来:
Nothing to do. None of the projects in this solution specify any packages for NuGet to restore.
这是一个 Visual Studio 2017 网站 .sln 文件,不包含有关 NuGet 的信息,也没有其他答案建议的 .csproj。
我通过将其指向 packages.config 文件解决了这个问题。现在还原过程确实找到了所需的包,但似乎没有将它们放在“Visual Studio Build”构建过程可以找到它们的地方。
Error CS0246: The type or namespace name 'Nest' could not be found (are you missing a using directive or an assembly reference?)
我查看了构建过程部分,但找不到任何有用的东西,因为唯一的参考标记为:
此选项已弃用。若要还原 NuGet 包,请添加 NuGet 工具安装程序
这就是我已经在尝试做的事情。我曾尝试将 NuGet 还原的目标目录移动到bin
其他地方,但这并没有什么不同。
恢复文件后,我是否缺少移动文件的步骤?或者我需要在构建时传递一个参数来告诉它包文件在哪里?
解决方案
推荐阅读
- python - 在 Python 中,如何让不和谐机器人在特定时间发送 3 条不同的消息,只发送一次,而不会与我的主代码冲突?
- xamarin.forms - 如何在 Xamarin.forms 中以编程方式访问讲述人?
- vega - Vega:如何在同一视图中显示多个图表
- python - 在python的新df列中为第一个单元格添加值
- apache-spark - 获取列表名称和列表值 Spark Redis
- python - 有什么方法可以让某些 API 方法避免 Django MAX_MEMORY 限制?
- javascript - 为什么我向 Spotify API 发出请求的 UseEffect 会出现错误 429?
- swift - 如何在 Swift 中拥有同名的变量和函数
- laravel-8 - laravel 将 value='laravel' 转换为 value='URL'
- typescript - 如何使用 Sequelize 键入聚合函数