繁体   English   中英

Nuget 获取应该在 .net 核心 SDK 中的包

[英]Nuget fetching packages that should be in the .net core SDK

If I create a new Azure Functions project and do dotnet restore -vn with a cleared nuget cache, I see that it fetches (among others) the following packages from https://api.nuget.org/v3/index.json as transitive Microsoft.NET.Sdk.Functions 4.1.1的依赖项(我安装的唯一顶级 package):

Installed Microsoft.AspNetCore.Http 2.1.0 from https://api.nuget.org/v3/index.json with content hash eAPryjDRH41EYY2sOMHCu+tHXLI6PUN1AsOPKst6GbiIoMi8wJCiPcE4h9418tKje1oUzmMc2Iz8fFPPVamfaw==.
Installed System.Net.Http 4.3.0 from https://api.nuget.org/v3/index.json with content hash sYg+FtILtRQuYWSIAuNOELwVuVsxVyJGWQyOnlAzhV4xvhyFnON1bAzYYC+jjRW8JREM45R0R5Dgi8MTC5sEwA==.
Installed System.Net.Sockets 4.3.0 from https://api.nuget.org/v3/index.json with content hash m6icV6TqQOAdgt5N/9I5KNpjom/5NFtkmGseEH+AK/hny8XrytLH3+b5M8zL/Ycg3fhIocFpUMyl/wpFnVRvdw==.

我的问题是,当它们是 .net 核心 SDK 的一部分时,为什么要从 nuget.org 获取这些包? 为什么不使用这些? 我肯定做错了什么。 不应该默认使用 SDK 中的包,而不是这些旧包,其中一些有漏洞(例如System.Net.Sockets 4.3.0 )?

我无法忽略这些,因为我们使用阻止这些包的公司 JFrog 存储库,因此nuget restore错误。 我正在展示使用 nuget.org 作为排除 JFrog 问题的来源的重现步骤。 它还从 nuget.org 下载(成功)这些旧包,因此它不会是存储库的问题。 它一定与我的 Visual Studio、nuget 配置、dotnet 核心安装等有关。我很乐意提供任何这些的具体细节。

任何帮助或建议将不胜感激。

在 Tools>Options>NuGet Package Manager 下检查 Package Sources。 在此处输入图像描述 If you uncheck the nuget.org it won't fetches packages from https://api.nuget.org/v3/index.json

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM