我安装了VS2015 Update 2,现在nuget包管理器找不到"Microsoft和.net"包源之外的任何包.看起来nuget包源已被删除.当我将其添加回" http://www.nuget.org "时,我收到错误"无法从一个或多个源检索结果".
其他人有这个问题吗?
我有一个在私有代理中运行的.NET解决方案的构建.该解决方案包含.NET Core 2.1和.NET Standard 2.0项目.
安装的一些nuget包如下:
尝试使用以下错误恢复nuget包时,构建失败:
"F:\ Agent01\w\141\s\xxxxxxx.sln"(恢复目标)(1) - >(恢复目标) - > C:\ Program Files\dotnet\sdk\2.1.500\NuGet.targets(114 ,5):错误:无法加载源https://xxxxxxxxxx.pkgs.visualstudio.com/_packaging/xxxxxxxxxx/nuget/v3/index.json的服务索引.C:\ Program Files\dotnet\sdk\2.1.500\NuGet.targets(114,5):错误:响应状态代码不表示成功:401(未授权).
构建任务如下:
这是%appdata%\NuGet\nuget.config构建代理中的文件内容:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="MyFeed" value="https://xxxxxxxxxx.pkgs.visualstudio.com/_packaging/xxxxxxxxxx/nuget/v3/index.json" />
</packageSources>
<packageSourceCredentials>
<MyFeed>
<add key="Username" value="LocalBuildAgent" />
<add key="ClearTextPassword" value="xxxxxxxxxxx" />
</MyFeed>
</packageSourceCredentials>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我已经检查了一些类似的问题,但到目前为止,我无法找到解决问题的方法.
一些说明:
我错过了什么?如何解决这个问题?为什么我不能使用dotnet restore命令恢复包? …
您好,我正在尝试dockerize一个ASP NET Core 2.1应用程序,docker build当它执行时失败dotnet restore。我已经检查了其他线程来解决此特定问题,
Nuget连接尝试失败“无法加载源的服务索引”。
那里提供的解决方案对我没有帮助。
Docker文件
ARG serverPath=./Core/Server
FROM microsoft/dotnet:sdk AS build-env
WORKDIR /app
COPY ./Core/Server/*.csproj ./
RUN dotnet restore //fails here
COPY ./Core/Server/ ./
RUN dotnet publish -c Release -o out
FROM microsoft/dotnet:2.1-aspnetcore-runtime
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet","Server.dll"]
Run Code Online (Sandbox Code Playgroud)
docker build的输出
$ docker build -t server .
Sending build context to Docker daemon 11.13MB
Step 1/11 : ARG serverPath=./Core/Server
Step 2/11 : FROM microsoft/dotnet:sdk AS …Run Code Online (Sandbox Code Playgroud) 这实际上并不是这个问题的重复,因为提供的答案不起作用,而且我正在使用 Bootcamp 在 MacBook 上使用 Windows-7。
我在尝试在 Nuget 包管理器中搜索任何包时收到以下错误:
严重性代码说明项目文件行抑制状态错误 [nuget.org] 无法加载源https://api.nuget.org/v3/index.json的服务索引。发送请求时发生错误。底层连接已关闭:发送时发生意外错误。无法从传输连接读取数据:现有连接被远程主机强制关闭。现有连接被远程主机强制关闭
我的 NuGet 配置文件 ( %appdata%/nuget):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
Run Code Online (Sandbox Code Playgroud) 我想通过使用Manage Nuget Packages安装Microsoft ASP.NET Identity Core,但是当我单击安装按钮时会发生以下错误:
底层连接已关闭:发送时发生意外错误
我正在使用Azure Devops和VS2017 15.9.7。我已登录Devops并可以同步。当我打开项目时,我会收到一条消息
"TF30063": You are not authorized to access dev.azure.com/myproject
Run Code Online (Sandbox Code Playgroud)
我尝试进入凭证管理器并删除devops组织的所有凭证。
我已经看过这个问题,并尝试通过VS中的浏览器注销
过去几天我一直在研究这个,我发现的研究都没有帮助我解决这个问题,包括重新启动 Docker、重新启动 Docker 服务、重新启动 Visual Studio、删除 Nuget、调整代理设置、调整 Nuget.config 等.
最终,我得到的错误消息是,Unable to load the service index for source https://api.nuget.org/v3/index.json.但请耐心等待,我正在给出重现此错误的具体步骤。
当我在 Visual Studio 2019 中创建 ASP.NET Core Web 应用程序,然后向项目添加 Docker 支持(右键单击项目,选择添加 -> Docker 支持...)时,会创建一个 Dockerfile,如下所示:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-nanoserver-1809 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1809 AS build
WORKDIR /src
COPY ["WebApplication3/WebApplication3.csproj", "WebApplication3/"]
RUN dotnet restore "WebApplication3/WebApplication3.csproj"
COPY . .
WORKDIR "/src/WebApplication3"
RUN dotnet build "WebApplication3.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "WebApplication3.csproj" -c …Run Code Online (Sandbox Code Playgroud) 请注意,我尝试使用 docker 桌面在本地构建此文件,而不是在 Azure CI/CD 管道中构建。
我已经使用https://github.com/microsoft/artifacts-credprovider开始了这个过程,但这也不起作用,后来发现新的 dotnet 恢复可以完成它的工作。因此,参考https://github.com/microsoft/artifacts-credprovider/issues/220后尝试了以下方法
以下是我尝试过的步骤。
我已经生成了 PAT。
下面是我的 docker 文件。
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["MyProj.csproj", "."]
COPY . .
WORKDIR "/src/."
ARG PAT
ARG FEED_URL
ENV NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED true
RUN dotnet nuget add source "${FEED_URL}" -u "noneed" -p "${PAT}" --store-password-in-clear- text --valid-authentication-types basic
RUN dotnet restore "./MyProj.csproj"
RUN dotnet build "MyProj.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "MyProj.csproj" -c …Run Code Online (Sandbox Code Playgroud) 我在使用Monodevelop时遇到了麻烦.我正在使用LinuxMint Serena(18.1)和Monodevelop 7.0.1(build 24).在尝试在新项目中添加nuget包时,我得到了下一个答案:
[nuget.org] Unable to load the service index for source https://api.nuget.org/v3/index.json. An error occurred while sending the request
Error: SecureChannelFailure (Object reference not set an instance of an object) Object reference not set to an instance of an object
Run Code Online (Sandbox Code Playgroud)
我检查api nuget地址是正常的,链接没什么奇怪的.我试图从原始的Visual Studio项目中复制旧包,但仍然存在问题.
提前致谢.
编辑:在尝试了许多没有成功的事情后,我使用从旧的Visual Studio项目下载的旧的nuget包.我不知道是否正常工作或我采用该项目并使用Monodevelop for Windows打开它修复了这个问题.
当我在 Visual Studio 中按下 NuGet 包上的“浏览”选项卡时,它显示“发生错误”并显示错误消息
[nuget.org] Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
The request was aborted: Could not create SSL/TLS secure channel.
Run Code Online (Sandbox Code Playgroud)
我已经使用 Visual Studio 和 NuGet 很长时间了,几天前 NuGet 还在工作。有人可以弄清楚为什么会发生这种情况以及我可以做些什么来解决它?
Visual Studio 2017 版本:15.9.17
我有一个Dockerfile-dev以此内容命名的文件:
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.102 AS build-env
WORKDIR /app
COPY . ./
RUN export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
# RUN dotnet restore
RUN dotnet publish -c Release -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.2
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "AspNetCore.dll"]
Run Code Online (Sandbox Code Playgroud)
docker build -f Dockerfile-dev .在 dotnet publish 命令上运行失败:
Step 5/9 : RUN dotnet publish -c Release -o out
---> Running in …Run Code Online (Sandbox Code Playgroud) 这是我的NuGet.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<disabledPackageSources>
<add key="Microsoft and .NET" value="true" />
</disabledPackageSources>
</configuration>
Run Code Online (Sandbox Code Playgroud)
现在,在Visual Studio中,当我尝试安装'geckofx45'软件包时,出现以下错误:
install-package geckofx45 install-package:无法加载源https://api.nuget.org/v3/index.json的服务索引。在第1行:char:1 + install-package geckofx45 + ~~~~~~~~~~~~~~~~~~~~~~~ + + CategoryInfo:未指定:(:) [Install-Package ],异常+ FullyQualifiedErrorId:NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
你有什么解决方案 ?
先感谢您
nuget ×8
docker ×3
.net-core ×2
asp.net-core ×2
azure-devops ×2
c# ×2
.net-6.0 ×1
build-agent ×1
docker-build ×1
dockerfile ×1
linux ×1
monodevelop ×1
windows ×1