简体   繁体   English

Nuget 恢复命令行响应 Package is not found on source - Artifactory 云服务器

[英]Nuget restore command line responds Package is not found on source - Artifactory cloud server

I know that the NuGet packages are there.我知道 NuGet 包在那里。 I can list them on my Artifactory page.我可以在我的 Artifactory 页面上列出它们。 Why can't my nuget restore command see them?为什么我的nuget restore命令看不到它们?

I have a server at JFrog Artifactory.我在 JFrog Artifactory 有一台服务器。 Let's say the URL is https://companyname.jfrog.io/artifactory .假设 URL 是https://companyname.jfrog.io/artifactory

I have a NuGet package repository at that location.我在该位置有一个 NuGet package 存储库。 The repository is called 'repo-name-local'.该存储库称为“repo-name-local”。

My NuGet packages show up as they should at https://companyname.jfrog.io/ui/repos/tree/General/repo-name-local我的 NuGet 包显示在https://companyname.jfrog.io/ui/repos/tree/General/repo-name-local

... and they appear in the repository listing at https://companyname.jfrog.io/ui/repos/tree/General/repo-name-local ...并且它们出现在https://companyname.jfrog.io/ui/repos/tree/General/repo-name-local的存储库列表中

On that page, the "URL to file" is given as https://companyname.jfrog.io/artifactory/repo-name-local/ .在该页面上,“文件的 URL”以https://companyname.jfrog.io/artifactory/repo-name-local/ 给出

I expect these three PowerShell commands to execute successfully:我希望这三个 PowerShell 命令能够成功执行:

# Start with a clean nuget.config
git checkout nuget.config
# Add package source, username, password
.\nuget.exe sources add -name "Artifactory" -source https://companyname.jfrog.io/artifactory/api/nuget/repo-name-local/ -username foo -password bar -configfile .\nuget.config
# Restore packages
.\nuget.exe restore -Source "https://companyname.jfrog.io/artifactory/api/nuget/repo-name-local/;https://www.nuget.org/api/v2" -ConfigFile .\nuget.config -Verbosity detailed .\Something\Something.sln

The first two commands execute successfully, but the third one gives this response:前两个命令成功执行,但第三个给出以下响应:

WARNING: Unable to find version '31.3.0.1035' of package 'GemBox.Spreadsheet'.
  C:\Users\rdepew\.nuget\packages\: Package 'GemBox.Spreadsheet.31.3.0.1035' is not found on source 'C:\Users\rdepew\.nuget\packages\'.
  https://companyname.jfrog.io/artifactory/api/nuget/repo-name-local/: Package 'GemBox.Spreadsheet.31.3.0.1035' is not found on source 'https://companyname.jfrog.io/artifactory/api/nuget/repo-name-local/'.
  https://www.nuget.org/api/v2: Package 'GemBox.Spreadsheet.31.3.0.1035' is not found on source 'https://www.nuget.org/api/v2'.
  

I thought that the modified URL was required, but maybe it wasn't.我认为修改后的 URL 是必需的,但也许不是。 So I change the commands a bit:所以我稍微改变了命令:

# Start with a clean nuget.config
git checkout nuget.config
# Add package source, username, password
.\nuget.exe sources add -name "Artifactory" -source https://companyname.jfrog.io/artifactory/repo-name-local/ -username foo -password bar -configfile .\nuget.config
# Restore packages
.\nuget.exe restore -Source "https://companyname.jfrog.io/artifactory/repo-name-local/;https://www.nuget.org/api/v2" -ConfigFile .\nuget.config -Verbosity detailed .\Something\Something.sln

The response is slightly different, but still not successful:响应略有不同,但仍然不成功:

WARNING: Unable to find version '31.3.0.1035' of package 'GemBox.Spreadsheet'.
  C:\Users\rdepew\.nuget\packages\: Package 'GemBox.Spreadsheet.31.3.0.1035' is not found on source 'C:\Users\rdepew\.nuget\packages\'.
  https://companyname.jfrog.io/artifactory/repo-name-local/: Failed to fetch results from V2 feed at 'https://companyname.jfrog.io/artifactory/repo-name-local/FindPackagesById()?id='GemBox.Spreadsheet'&semVerLevel=2.0.0' with following message : Response status code does not indicate success: 404 (Not Found).
  Response status code does not indicate success: 404 (Not Found).
  https://www.nuget.org/api/v2: Package 'GemBox.Spreadsheet.31.3.0.1035' is not found on source 'https://www.nuget.org/api/v2'.

Why are both nuget restore commands failing?为什么nuget restore命令都失败了? Why can't they see the repository contents?为什么他们看不到存储库内容?

I hit to the similar issue, resolved by enabling force authentication for nuget repo.我遇到了类似的问题,通过为 nuget repo 启用强制身份验证来解决。

Nuget Settings Nuget 设置

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Artifactory通过PowerShell的身份验证还原nuget软件包 - Artifactory restore nuget packages with authentication from powershell 使用命令行检查nuget包是否存在 - Check if nuget package exists using command line NuGet - 从命令行添加新的包提要 - NuGet - add a new package feed from command line Powershell Find-Package 命令不适用于 nuget v3 包源 - Powershell Find-Package command doesn't work with nuget v3 package source Powershell: How do I install the Nuget provider for PowerShell on a unconnected machine so I can install a nuget package from the PS command line? - Powershell: How do I install the Nuget provider for PowerShell on a unconnected machine so I can install a nuget package from the PS command line? 如何显示nuget包的源存储库? - How to display source repository of a nuget package? 在 PowerShell 脚本中,如何还原包以解决错误:此项目引用此计算机上缺少的 NuGet 包 - In PowerShell script, how can I restore packages to resolve error: This project references NuGet package(s) that are missing on this computer Nuget powershell命令 - 查找安装了特定软件包的项目 - Nuget powershell command - find projects with specific package installed 在Visual Studio Nuget包管理器控制台中中止“unclosed”powershell命令 - Aborting an “unclosed” powershell command in Visual Studio Nuget Package manager console 为什么Nuget在通过命令行恢复包时会随机崩溃? - Why is Nuget randomly crashing when restoring packages via command line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM