Nuget与Artifactory.密钥在指定状态下无效 [英] Nuget with Artifactory. Key not valid for use in specified state

查看:115
本文介绍了Nuget与Artifactory.密钥在指定状态下无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Artifactory作为NuGet存储库来存储所有nuget包.当我们使用此Artifactory链接作为源时,Visual Studio中的程序包管理器会提示您输入凭据,并且效果很好.一旦我们开始构建机器(不使用VS)并尝试构建应用程序,它就会引发错误:

I am using Artifactory as NuGet repository to store all the nuget packages. When we use this Artifactory link as source, the package Manager in Visual Studio prompts for credentials and worked very fine. As soon as we moved to build machine (with out VS) and try to build application it is throwing error :

.nuget \ NuGet.targets(100,9):错误:密钥不适用于指定状态.

.nuget\NuGet.targets(100,9): error : Key not valid for use in specified state.

我用-user -password添加了源,并将配置放在本地用户位置.我尝试使用ClearText密码和加密密码都抛出相同的错误.

I added source with -user -password and put config at local user location. I tried with ClearText password and encrypted password both are throwing same error.

我在这里错过了什么吗?请指教.

Am I missing anything here? Please advice.

推荐答案

我认为该错误与Artifactory无关.NuGet报告的问题与nuget.config文件中的用户凭据加密/解密有关.

I believe the error isn't related to Artifactory. The issue NuGet reports is related with encrypting/decrypting user credentials in nuget.config files.

当我尝试为存储库设置apiKey时遇到错误:

I encountered the error when I tried to set apiKey for a repo:

NuGet setapikey user:pwd -Config .\NuGet.test.Config -Source .\packages

NuGet报告密钥在指定状态下无效".我在NuGet.test.Config附近有NuGet.config文件.该nuget.config包含 packageSourceCredentials 部分,该部分具有其他用户的凭据(而不是传递给setapikey的凭据).从nuget.config中删除该凭据后,错误消失了.

NuGet reported "Key not valid for use in specified state". I had NuGet.config file located near NuGet.test.Config. That nuget.config contained packageSourceCredentials section with credentials of other user (than one which was passed to setapikey). After I remove that credentials from nuget.config the error gone.

这篇关于Nuget与Artifactory.密钥在指定状态下无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆