来自Visual Studio Team Services的未经授权的nuget程序包,使用asp.net core rc2

编程入门 行业动态 更新时间:2024-10-18 18:25:32
本文介绍了来自Visual Studio Team Services的未经授权的nuget程序包,使用asp core rc2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我无法从asp核心Web应用程序(RC2)中的Visual Studio Team Services提要安装/还原nuget程序包.我收到以下信息:

I am unable to install/restore nuget packages from a Visual Studio Team Services feed in an asp core web application (RC2). I receive the following:

错误:响应状态代码不指示成功:401 (未经授权).

error: Response status code does not indicate success: 401 (Unauthorized).

我正在运行Visual Studio Community 2015 Update 2和nuget版本3.4.4.我可以从其他其他项目类型的Feed中安装/恢复软件包.

I am running Visual Studio Community 2015 Update 2 and nuget version 3.4.4. I am able to install/restore packages from this feed in other project types.

我需要做其他事情来传递我的asp核心网络应用程序的凭据吗?

Do I need to do something else to pass my credentials for an asp core web app?

复制步骤:

从团队服务"包选项卡中,选择连接到源"并复制NuGet包源URL

From Team Services package tab I select "Connect to Feed" and copy the NuGet package source URL

在Visual Studio中->工具-> NuGet程序包管理器->程序包管理器设置->程序包源,并从vso添加供稿网址

In visual studio -> Tools -> NuGet Package Manager -> Package Manager settings -> Package sources and add the feed url from vso

然后从我的ASP.NET Core Web应用程序(.NET Framework)项目中右键单击引用->管理NuGet包 ->从程序包来源"中选择我的提要(列出了程序包)->单击以安装

Then from my ASP.NET Core Web Application (.NET Framework) project right click references -> Manage NuGet Packages -> Select my feed from Package source (packages are listed) -> Click to install

在输出中:

Installing NuGet package xxxxx Successfully installed xxxxx to WebApplication1 ========== Finished ==========

然后它将尝试恢复我得到的软件包:

Then it will try to restore the package at which point I get:

error: Response status code does not indicate success: 401 (Unauthorized). error: Failed to retrieve information from remote source

以及内部Web项目引用-程序包中带有警告图标-NU1001无法解析依赖项xxxxx

And inside web project references - package has warning icon - NU1001 The dependency xxxxx could not be resolved

推荐答案

我可以在您的身边重现您的问题,以下是我用来还原软件包的解决方法:

I can reproduce your issue at my side and following is the workaround I use to restore the packages:

  • 从"VS \ Tools \ NuGet程序包管理器\包源"中删除VSTS提要资源.
  • 从VSTS网站门户中打开软件包"标签.
  • 选择要连接的供稿,然后单击连接到供稿"选项.
  • 在对话框中选择个人访问令牌"方法.
  • 在对话框中复制生成的命令.
  • 在计算机上以管理员身份运行CMD.
  • 将复制的命令粘贴到CMD中.
  • 在命令后添加"-StorePasswordInClearText"参数.
  • 运行命令.
  • 重新启动VS.
  • 安装和还原软件包.
  • Remove the VSTS feed resource from "VS\Tools\NuGet Package Manager\Package sources".
  • Open "Packages" tab from your VSTS web portal.
  • Select the feed you want to connect and click "Connect to feed" option.
  • Select "Personal Access Tokens" method in the dialog.
  • Copy the generated command in the dialog.
  • Run CMD as Administrator on you machine.
  • Paste the copied command into CMD.
  • Add "-StorePasswordInClearText" argument after the command.
  • Run the command.
  • Restart the VS.
  • Install and restore the packages.
  • 更多推荐

    来自Visual Studio Team Services的未经授权的nuget程序包,使用asp.net core rc2

    本文发布于:2023-11-14 15:02:39,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1587675.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:未经授权   程序包   Services   Visual   Studio

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!