私たちは、企業プロキシの背後にあるパッケージを復元できないというNuGetの問題に本当に苦労しています。私は私たちの設定を行きます。NuGetはプロキシの背後にあるパッケージを復元できません
ハードウェア/ソフトウェア:
WinServer 2012 R2 は
NuGetエラー
基本的に復元アップデート2でTFS 2017
ドメインにし、企業のプロキシの背後に参加しました私たちがやっていることは、私たちの環境のビルドの自動化をセットアップしようとしていることですent。今、私たちはそれを試しているだけで、ビルド定義にNuGet Restoreステップを備えた基本的なVisual Studio Appを作成しました。
Sady NuGet復元手順は、次のエラーで失敗します。ログから関連するファイルは以下の通りです:
2017-08-11T13:49:41.7282874Z Unable to find version '1.5.2' of package 'WebGrease'.
2017-08-11T13:49:41.7282874Z https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json.
2017-08-11T13:49:41.7282874Z An error occurred while sending the request.
2017-08-11T13:49:41.7282874Z Unable to connect to the remote server
2017-08-11T13:49:41.7282874Z A socket operation was attempted to an unreachable network [2606:2800:11f:17a5:191a:18d5:537:22f9]:443
2017-08-11T13:49:41.7282874Z
2017-08-11T13:49:41.7282874Z NuGet Config files used:
2017-08-11T13:49:41.7282874Z C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\NuGet\NuGet.Config
2017-08-11T13:49:41.7282874Z
2017-08-11T13:49:41.7282874Z Feeds used:
2017-08-11T13:49:41.7282874Z https://api.nuget.org/v3/index.json
2017-08-11T13:49:41.8064377Z ##[error]Error: C:\agent\_work\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\4.0.0\NuGet.exe failed with return code: 1
2017-08-11T13:49:41.8064377Z ##[error]Packages failed to install
2017-08-11T13:49:41.8064377Z ##[section]Finishing: NuGet restore **\*.sln
我々はログから
を試してみました何、NuGet.configファイルがここに置かれていることは明らかである:
C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\NuGet\NuGet.config
ときに我々次のようにNuGet.configファイルを変更して、プロキシ設定を含めます。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<config>
<add key="http_proxy" value="http://MY_USER_NAME:[email protected]_DOMAIN.com" />
</config>
</configuration>
は、その後エラーが異なることになる:サーバーがプロキシを経由せずにインターネットに接続されている場合
Unable to find version '1.5.2' of package 'WebGrease'.
https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
The remote server returned an error: (400) Bad Request.
すべてが正常に動作します。
誰も同じ問題を経験しましたか?プロキシ設定が正しいかどうかどんな助けでも本当に感謝しています。
ありがとうございます。
エラーメッセージに基づいて、Proxy Serverに問題があるはずです。 "api.nuget.org"サイトに接続することはできません。プロキシサーバーがインターネットにアクセスできるかどうかを確認してください。また、 "api.nuget.org"サイトにアクセスするためにプロキシサーバーを制限するポリシー/ファイアウォール設定がないことを確認してください。参考:http://codesteer.com/blog/nuget-work-behind-proxy/ –
アンディ、返事をありがとう。私はITスタッフと話をしました。彼らはドメインユーザーのアカウントでVSTS Build Agentを実行するように設定することを勧めました。以前は、Under Network ServiceとLocal Systemアカウントを実行するようにVSTSビルドエージェントを設定しましたが、これらのいずれも機能しませんでした。 – WebDev
したがって、ドメインユーザーアカウントでVSTSビルドエージェントを実行するように設定することで問題を解決しましたか?そうであれば、回避策を回答として投稿し、[回答として受諾](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work)することができます。このスレッドを読んでいる他のコミュニティーのメンバーにとって有益です。 –