简体   繁体   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 dependencies of Microsoft.NET.Sdk.Functions 4.1.1 (the only top-level package I have installed): 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==.

My question is why is it fetching these packages from nuget.org when they are part of the .net core SDK?我的问题是,当它们是 .net 核心 SDK 的一部分时,为什么要从 nuget.org 获取这些包? Why is it not using those?为什么不使用这些? Surely I am doing something wrong.我肯定做错了什么。 Shouldn't the default be to use the packages from the SDK, not these old packages, some of which have vulnerabilities ( System.Net.Sockets 4.3.0 for example)?不应该默认使用 SDK 中的包,而不是这些旧包,其中一些有漏洞(例如System.Net.Sockets 4.3.0 )?

I'm not able to ignore these because we use a corporate JFrog repository that blocks these packages, so nuget restore errors when using that as a source.我无法忽略这些,因为我们使用阻止这些包的公司 JFrog 存储库,因此nuget restore错误。 I'm showing the repro steps with nuget.org as the source to rule out an issue with JFrog.我正在展示使用 nuget.org 作为排除 JFrog 问题的来源的重现步骤。 It also downloads (successfully) these old packages from nuget.org, so it can't be an issue with the repository.它还从 nuget.org 下载(成功)这些旧包,因此它不会是存储库的问题。 It must be something with my Visual Studio, nuget configuration, dotnet core installation, etc. I'm happy to volunteer specific details on any of these.它一定与我的 Visual Studio、nuget 配置、dotnet 核心安装等有关。我很乐意提供任何这些的具体细节。

Any help or suggestions would be much appreciated.任何帮助或建议将不胜感激。

Check your Package Sources under Tools>Options>NuGet Package Manager.在 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 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