简体   繁体   English

Visual Studio 2015更新3无法读取NuGet程序包

[英]Visual Studio 2015 update 3 cannot read NuGet package

I am able to read packages from NuGet.org but I am not able to read only certain packages from our private NuGet server - Klondike . 我可以从NuGet.org中读取软件包,但不能仅从我们的私有NuGet服务器Klondike中读取某些软件包。

I tracked requests which VS2015 made to download package and query string which VS2015 sends to NuGet source is: 我跟踪了VS2015提出的下载VS2015发送到NuGet源的程序包和查询字符串的请求是:

?$filter=IsAbsoluteLatestVersion&searchTerm='Package-ID'&targetFramework='net'&includePrerelease=true&$skip=0&$top=126

Problem is with parameter targetFramework . 问题在于参数targetFramework When VS2015 uses targetFramework='net' than it cannot read packages for framework net461 , they are skipped. 当VS2015使用targetFramework='net' ,它无法读取框架net461软件包,因此将跳过它们。

When I executed request in Postman and set targetFramework='net461' then I am able to find package. 当我在Postman中执行请求并设置targetFramework='net461'时,便可以找到程序包。

Also I noticed that VS2015 sporadically changing target framework from net to net461 . 我还注意到VS2015偶尔将目标框架从net更改为net461

My question is: Do I need to configure my VS2015 or I have to change my NuGet package? 我的问题是: 我需要配置VS2015还是必须更改NuGet软件包?

NuGet package is created form .NET Core 2.0 project and here is configuration: NuGet包是从.NET Core 2.0项目创建的,配置如下:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
    <Company>Stackoverflow</Company>
    <Authors>kat1330</Authors>
    <Description>Package consists banch of functionalities.</Description>
    <PackageTags>rules, rule engine</PackageTags>
    <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
    <IncludeSymbols>true</IncludeSymbols>
    <IncludeSource>True</IncludeSource>
    <SignAssembly>true</SignAssembly>
    <AssemblyOriginatorKeyFile>..\cert.snk</AssemblyOriginatorKeyFile>
    <DelaySign>true</DelaySign>
    <VersionPrefix>1.0.0</VersionPrefix>
    <VersionSuffix>$(VersionSuffix)</VersionSuffix>
    <ApplicationIcon>favicon.ico</ApplicationIcon>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
  </ItemGroup>

</Project>

UPDATE: Version of NuGet package manager is: 3.5.0.1484 . 更新:NuGet软件包管理器的版本是: 3.5.0.1484 It is latest what is offered on Visual Studio 2015 for me. 这是Visual Studio 2015为我提供的最新内容。

I am able to find packages form nuget.org and "certain packages" from private source. 我可以从nuget.org中找到软件包,并可以从私人来源中找到“某些软件包”。 "Certain Packages" means some are visible and some not “某些软件包”表示某些可见,而有些则不可见

Since you able to find packages form nuget.org and "certain packages" from private source ("Certain Packages" means some are visible and some not), so, the reason for the invisible package should be related to the package itself not about the nuget and private source. 由于您可以从nuget.org和“某些包”中找​​到私有包(“某些包”表示某些可见,而有些则不可见),因此,不可见包的原因应与包本身有关,而不是与nuget和私人资源。

According to the sample config for package, I noticed that the value of GeneratePackageOnBuild is set to False rather than True : 根据包的示例配置,我注意到GeneratePackageOnBuild的值设置为False而不是True

  <PropertyGroup>
    ...
    <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
    ...
  </PropertyGroup>

When the value is set to false , Visual Studio will not generate package. 当该值设置为false时 ,Visual Studio将不会生成包。 So, you should make sure if the package is generated. 因此,您应确保是否生成了软件包。 If it was generated, check if you can access it and download it. 如果已生成,请检查是否可以访问并下载。

Hope this helps. 希望这可以帮助。

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

相关问题 无法在nuget包管理器visual studio 2015上安装“Microsoft.AspNet.Razor 3.2.3” - Cannot install “Microsoft.AspNet.Razor 3.2.3” at the nuget package manager visual studio 2015 在Visual Studio 2015中使用NuGet安装软件包后,无法在参考中找到Math.net - Cannot find Math.net in References after installing package with NuGet in Visual Studio 2015 无法在Visual Studio 2015 Web API项目中添加nuget程序包 - Can not add a nuget package in visual studio 2015 web api project Visual Studio 2015 - NuGet包删除所有项目引用 - Visual Studio 2015 - NuGet package removes all project references NuGet包在visual studio 2015和Xamarin中引起麻烦 - NuGet package causes trouble in visual studio 2015 and Xamarin 从 NuGet package Visual Studio 2022 中删除或更新库依赖项 - Remove or Update library dependency from NuGet package Visual Studio 2022 无法安装Visual Studio C#NuGet程序包 - Cannot install Visual Studio C# NuGet package 无法在Visual Studio 2012中安装Nuget程序包帮助页面 - Cannot install Nuget Package HelpPage in Visual Studio 2012 2015 visual studio Nuget程序包管理器不允许我保存新的程序包源,并且Nuget.Config无效的XML - 2015 visual studio Nuget package manager does not let me save new package sources and Nuget.Config is not valid XML Nuget 包未在 Visual Studio 中更新 - Nuget package not updating in Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM