まず、パッケージ ソース (テスト) を追加します。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="test" value="https://mytestpackagesource" />
</packageSources>
</configuration>
実行するdotnet restore
と、予期される 401 (Unauthorized) が返されます。したがって、資格情報を追加します。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="test" value="https://mytestpackagesource" />
</packageSources>
<packageSourceCredentials>
<test>
<add key="Username" value="apparently this can be anything when you use a token?" />
<add key="ClearTextPassword" value="my personal access token" />
</test>
</packageSourceCredentials>
</configuration>
そして、これは機能します。しかし、トークンを無効なものに変更したり、packageSourceCredentials
要素を完全に削除したりしても、トークンは別の場所に保存されていると思われます。だから私の質問は、それがどこに保存され、どのように更新するのですか?