Search code examples
xamarin.formsvisual-studio-app-center

Microsoft App Center add external package


How I do add packages sources in my project?

In my Visual Studio, i go to tools -> options -> Nuget Package Manager -> Package Sources.

And add the package information that in this case is not in Nuget. Now in the App Center I did not find this information and with this my project does not compile


Solution

  • You can create a NuGet.config file as described in the docs.

    <?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>