的NuGet包还原找不到包,没有源代码

编程入门 行业动态 更新时间:2024-10-25 06:33:33
本文介绍了的NuGet包还原找不到包,没有源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个包在我的TeamCity的NuGet饲料,通过TeamCity的构建,但包在一个相关的技术合作项目无法看到它恢复。

I have a package on my TeamCity NuGet feed, built by TeamCity, but a dependent TC project cannot see it during package restore.

[14点05分02秒] [执行] E:\ TeamCity的-BuildAgent \工作\ 62023563850993a7 \ Web.nuget \ nuget.targets(88,9):找不到版本1.0.17.0'包'MarkLogicManager40

[14:05:02][Exec] E:\TeamCity-BuildAgent\work\62023563850993a7\Web.nuget\nuget.targets(88, 9): Unable to find version '1.0.17.0' of package 'MarkLogicManager40'.

[14点05分02秒] [执行] E:\ TeamCity的-BuildAgent \工作\ 62023563850993a7 \ Web.nuget \ nuget.targets(88,9):错误MSB3073:命令E:\ TeamCity的-BuildAgent \工作\ 62023563850993a7 \ Web.nuget \ nuget.exe安装E:\ TeamCity的-BuildAgent \工作\ 62023563850993a7 \ ProductMvc \ packages.config-source-RequireConsent -solutionDirE:\ TeamCity的-BuildAgent \工作\ 62023563850993a7 \网络\退出,code 1。

[14:05:02][Exec] E:\TeamCity-BuildAgent\work\62023563850993a7\Web.nuget\nuget.targets(88, 9): error MSB3073: The command ""E:\TeamCity-BuildAgent\work\62023563850993a7\Web.nuget\nuget.exe" install "E:\TeamCity-BuildAgent\work\62023563850993a7\ProductMvc\packages.config" -source "" -RequireConsent -solutionDir "E:\TeamCity-BuildAgent\work\62023563850993a7\Web\ "" exited with code 1.

请注意,在的NuGet命令行源参数为空。难道这是原因?

Note that the source parameter in the NuGet command line is empty. Could this be the cause?

推荐答案

截至今日,NuGet.targets有以下方法来指定自定义源(S):

As of today, NuGet.targets has the following way to specify custom feed(s):

<ItemGroup Condition=" '$(PackageSources)' == '' "> <!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used --> <!-- The official NuGet package source (nuget/api/v2/) will be excluded if package sources are specified and it does not appear in the list --> <PackageSource Include="nuget/api/v2/" /> <PackageSource Include="\\MyShare" /> <PackageSource Include="MyServer/" /> </ItemGroup>

另一种选择是把 NuGet.config 旁边的解决方案文件:

Another option is to put NuGet.config next to the solution file:

<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="nuget" value="www.nuget/api/v2/" /> <add key="MyShare" value="\\MyShare" /> <add key="MyServer" value="MyServer" /> </packageSources> <activePackageSource> <add key="All" value="(Aggregate source)" /> </activePackageSource> </configuration>

更多推荐

的NuGet包还原找不到包,没有源代码

本文发布于:2023-11-03 15:53:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555505.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   源代码   NuGet

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!