nuget - 如何获取myget包源码?

标签 nuget myget

我正在使用 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/

相关文章:

powershell - 在程序包管理器控制台中,出现 'Set-Location' 无法识别错误,无法加载

msbuild - 用于多个框架的 Nuget 包

c++ - 如何在 C++ 应用程序中使用 curl Nuget 包

npm - 我无法登录 myGet npm 存储库 (sencha/extjs-ce)

asp.net-core - aspnetcidev 和 aspnetvnext 之间的区别?

c# - MyGet 和 Cake,生成版本号

visual-studio - 没有程序集的 NuGet 包提示缺少程序集

nuget - 如何从 HTTP URI(本地托管在 IIS 上)安装包?

Nuget 错误 : Please provide credentials for: https://www. myget.org/F

c# - NuGet 安装包不起作用。我怎样才能获得更详细的信息来帮助调试失败的原因?