--- lang: ja-jp breaks: true --- # `dotnet cli` で NuGetのグローバルインストールを行うと、プライベートパッケージソースを参照して認証できずにエラーとなる 2022-07-12 ## ユーザフォルダの`NuGet.config`にプライベートパッケージソースの認証情報 `packageSourceCredentials` を記載することで解決 ```shell= %appdata%\NuGet\NuGet.config ``` ```xml= <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="xxxxxxxx" value="https://nuget.pkg.github.com/xxxxxxxx/index.json" /> <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> </packageSources> <packageRestore> <add key="enabled" value="True" /> <add key="automatic" value="True" /> </packageRestore> <bindingRedirects> <add key="skip" value="False" /> </bindingRedirects> <packageManagement> <add key="format" value="1" /> <add key="disabled" value="False" /> </packageManagement> <activePackageSource> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> </activePackageSource> <packageSourceCredentials> <xxxxxxxx> <add key="Username" value="xxxxxxxx@gmail.com" /> <add key="ClearTextPassword" value="ghp_xxxxxxxxxxxxxxxxxxxx" /> </xxxxxxxx> </packageSourceCredentials> </configuration> ``` ###### tags: `NuGet` `dotnet cli`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up