我正在使用 myget 作为我的 Nuget 包。因为我使用带有凭据的私有(private)提要,所以我关注了此博客:http://www.xavierdecoster.com/deploying-to-azure-web-sites-using-nuget-package-restore-from-a-secured-feed
我的本地(项目)nuget.config(位于解决方案中的 .nuget 文件夹中)如下所示:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSource>
<clear />
<add key="EcareMyGet" value="https://www.myget.org/F/rai69/"></add>
</packageSource>
<activePackageSource>
<add key="EcareMyGet" value="https://www.myget.org/F/rai69/"></add>
</activePackageSource>
<packageSourceCredentials>
<EcareMyGet>
<add key="Username" value="www.myget.org/raimond" />
<add key="ClearTextPassword" value="wachtwoord" />
</EcareMyGet>
</packageSourceCredentials>
</configuration>
在我的 nuget.targets 中,我根据博客更改了恢复命令:
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -NonInteractive $(RequireConsentSwitch) -solutionDir "$(SolutionDir)\" -Verbosity detailed </RestoreCommand>
尽管如此,构建服务器仍然使用 nuget.org 作为源:
NuGet.exe sources
Registered Sources:
1. https://nuget.org/api/v2/ [Enabled]
https://nuget.org/api/v2/
谁知道解决办法?
最佳答案
答案:将 nuget.config 文件中的
下面是得出答案的对话...
为了确定,您是否也阅读了禁用 -RequireConsent 开关的部分?
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">
false
</RequireRestoreConsent>
此外,请确保您没有在 MSBuild PackageSources 元素中配置它,默认情况下如下所示(未配置包源):
<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 (https://nuget.org/api/v2/) will be
excluded if package sources are specified and it does not appear
in the list -->
<!--
<PackageSource Include="https://nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
-->
</ItemGroup>
如果您这样做了,但这不是问题,您能否分享有关输出日志的更多详细信息,以便我可以确定问题何时以及由什么命令引起?
关于nuget - 如何获取myget包源码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17276768/