Microsoft App Center 添加外部包

Microsoft App Center add external package

如何在我的项目中添加包源?

在我的 Visual Studio 中,我转到工具 -> 选项 -> Nuget 包管理器 -> 包源。

并添加本例中Nuget中没有的包信息。现在在 App Center 中我没有找到这些信息,因此我的项目无法编译

您可以按照文档中的说明创建 NuGet.config 文件。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget" value="https://api.nuget.org/v2/index.json" />
    <add key="MyGet" value="https://www.myget.org/F/MyUsername/api/v2/index.json" />
    <add key="MyAuthNuget" value="https://nuget.example.com/v2/index.json" />
  </packageSources>
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
  <packageSourceCredentials>
    <MyAuthNuget>
      <add key="Username" value="$USER_VARIABLE" />
      <add key="ClearTextPassword" value="$PASSWORD_VARIABLE" />
    </MyAuthNuget>
  </packageSourceCredentials>
</configuration>

也许这也会对某些人有所帮助。对我来说,上述解决方案没有奏效。所以我发现了什么 - 始终检查包的官方来源是否与您的配置相同。目前 nuget 源代码已更改为版本 3:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <activePackageSource>
        <add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
    </activePackageSource>
</configuration>