简体   繁体   English

Nuget安装程序包和网络共享

[英]Nuget install-package and network shares

We have a private nuget repository for sharing internal components. 我们有一个私有的nuget存储库,用于共享内部组件。 For now, we are just using a network share. 目前,我们仅使用网络共享。

I am running into some problems though: Everything works fine if I use the Package Manager Dialog box -- I can search for my packages, install them, and build. 但是,我遇到了一些问题:如果使用“程序包管理器”对话框,一切都可以正常工作-我可以搜索我的程序包,安装它们并进行构建。

However, if I use the Package Manager Console command: install-package My.Package (where My.Package is the exact string in the <id> tag of the nuspec file, I get an error indicating the nuget could not find the package. 但是,如果我使用Package Manager控制台命令:install-package My.Package(其中My.Package是nuspec文件的<id>标记中的确切字符串),我会收到一条错误消息,指示nuget找不到软件包。

If I include the version number in install-package: install-package My.Package.1.0.0, then it works from the console. 如果我在install-package中包含版本号:install-package My.Package.1.0.0,则可以从控制台运行。

BUT, our build server fails to download our packages with the same error I get from install-package. 但是,我们的构建服务器无法下载我们的软件包,并出现与从install-package相同的错误。 (our build server uses package restore) (我们的构建服务器使用软件包还原)

I have compared my nuspec files with some publicly available packages that work find. 我将nuspec文件与可以找到的一些公开可用的软件包进行了比较。 The only difference I can find is that our nuget packages are on a network share, but public ones are on a web server. 我可以找到的唯一区别是,我们的nuget程序包在网络共享上,而公共程序在Web服务器上。

Is there a behavior difference if you use a network share? 如果使用网络共享,行为上会有区别吗?

I figured out what the problem was -- it was mostly user error. 我弄清楚问题出在哪里-主要是用户错误。

I went through my nuget config, and I found this: 我检查了我的nuget配置,发现了这一点:

<activePackageSource>
  <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</activePackageSource>

That setting tells nuget to only search nuget.org, and not our private feed. 该设置告诉nuget仅搜索nuget.org,而不搜索我们的私人供稿。 Had to change it to this: 不得不将其更改为:

<activePackageSource>
  <add key="All" value="(Aggregate source)" />
</activePackageSource>

I'm still not sure why it worked before (sometimes) if you included the version number (maybe it had to do with whether the package was already locally cached?? It seems as though it should not have worked at all until I made this change. This fixed it though. 我仍然不确定为什么(如果有)您包括版本号(有时与软件包是否已经在本地缓存有关)在以前(有时)起作用了吗?似乎在我这样做之前它根本就不起作用了。改变,尽管如此。

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

相关问题 Nuget Install-Package成功,但没有添加引用到csproj - Nuget Install-Package successful but no reference added to csproj Nuget 包安装错误:Install-Package Google.Apis.Drive.v3 - Nuget package installation error: Install-Package Google.Apis.Drive.v3 有没有办法在Nuget中使用Install-Package时指定.NET Framework Version参数? - Is there a way to specify .NET Framework Version argument while using Install-Package in Nuget? 安装包:无法找到包'WebActivator' - Install-Package : Unable to find package 'WebActivator' 使用Cake从网络驱动器安装Nuget包 - Install Nuget Package from Network Drive with Cake 在安装包中添加自定义参数 - adding custom parameter to install-package NuGet安装软件包不起作用。 如何获取更多详细信息以帮助调试为什么失败? - NuGet install-package doesn't work. How can I get more verbose information to help debug why this is failing? 安装包FluentValidation总是失败 - Install-Package FluentValidation always fail 安装包:无法找到包“CommonServiceLocator.MefAdapter” - Install-Package : Unable to find package 'CommonServiceLocator.MefAdapter 安装包:无法找到包&#39;Phone.Notifications.BasePage。&#39; - Install-Package : Unable to find package 'Phone.Notifications.BasePage.'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM