【问题标题】:Microsoft App Center add external package微软应用中心添加外部包
【发布时间】:2020-06-25 19:50:16
【问题描述】:

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

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

并添加在这种情况下不在Nuget中的包信息。现在在 App Center 中我没有找到此信息,因此我的项目无法编译

【问题讨论】:

    标签: xamarin.forms visual-studio-app-center


    【解决方案1】:

    您可以按照文档中的说明创建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>
    

    【讨论】:

      【解决方案2】:

      也许这也会对某人有所帮助。对我来说,上述解决方案没有奏效。所以我发现 - 始终检查软件包的官方来源是否与您的配置中的相同。目前 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>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-03-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-01-03
        • 1970-01-01
        相关资源
        最近更新 更多