【发布时间】:2019-10-07 13:09:18
【问题描述】:
我正在使用 Azure Dev Ops 来处理我的 ASP.NET Core Web 应用程序。我正在设置管道,但出现错误。错误来自包还原问题,因为我的应用程序使用 KendoUI 库,我必须为所需的私有 NuGet 包创建服务连接。完成后,构建仍然失败,我想知道出了什么问题?
错误信息
[错误] nuget 命令失败,退出代码 (1) 和错误 (NU1102: Unable to find package Telerik.UI.for.AspNet.Core with version (>=
2019.2.619) - 在 NuGetOrg 中找到 1 个版本 [最近的版本:2016.3.914] d:\a\1\s\MyCompany\MyProject.UI.csproj 中的错误 NU1102:无法找到版本为 (>= 2019.2.619) 的包 Telerik.UI.for.AspNet.Core - 在 NuGetOrg 中找到 1 个版本 [最近的版本:2016.3.914])
[错误]包恢复失败
我与 Telerik 支持人员交谈过,他们说上述代码是因为身份验证失败,导致系统寻找导致此兼容性问题的旧版本。我被要求检查我的身份验证,但此错误仍然存在。
我遵循 Telerik 提供的有关如何实现此目的的文档,您可以在此处找到:https://www.telerik.com/blogs/azure-devops-and-telerik-nuget-packages
好的,首先,我的项目在其根目录中有一个nuget.config 文件。文件内容为:
nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSources>
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key="Telerik" value="https://nuget.telerik.com/nuget" />
</packageSources>
<packageSourceCredentials>
<Telerik>
<add key="Username" value="me@mybusiness.com" />
<add key="ClearTextPassword" value="MyFunkYPassword19!" />
</Telerik>
</packageSourceCredentials>
</configuration>
在 Azure Dev Ops 中,我按照他们的文档中描述的方式创建了一个服务连接,其名称为用户名和密码作为上述代码
在我的管道中,我添加了 Nuget 包,该包设置为使用上面的服务连接进行恢复。
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
nugetConfigPath: 'MyProject/nuget.config'
externalFeedCredentials: 'Telerik NuGet'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
上述流水线步骤的设置如下:
有没有人知道发生了什么,我的设置不正确吗?
【问题讨论】:
-
NuGet 还原步骤的输出是什么?
-
我今天遇到了完全相同的问题,我一直在努力解决问题,但最后,是我的许可证刚刚过期并开始面临这个问题。
标签: azure kendo-ui azure-devops nuget azure-pipelines