2017-01-30 36 views
0

私はVisual Studio 2015をXamarinのアプリケーション開発に使用しています。私はプロキシの背後で作業しています。プロキシ(httpプロキシ)をVisual Studio 2015に設定する必要がありますプロキシを設定するようなウィンドウが表示されますか?Visual Studioでプロキシを設定する方法2015

答えて

7

インストールディレクトリにdevenv.exe.configがあります。

このテキストファイルを開き、ノード<system.net>の中にノード<defaultProxy>を追加します。

<system.net> 
<defaultProxy useDefaultCredentials="true" enabled="true"> 
    <proxy bypassonlocal="true" proxyaddress="http://yourproxyaddress.net:8080" /> 
</defaultProxy> 
</system.net> 
+0

[Proxy Authorization Required](https://msdn.microsoft.com/en-us/library/dn771556.aspx) – lindexi

+0

私はこれを行うと起動時に「構成をマージできませんでした」というエラーが表示されます – Zanidd

0

あなたはここにdescripedのように、独自のプロキシ認証モジュールを作成することができます。

https://blogs.msdn.microsoft.com/rido/2010/05/06/how-to-connect-to-tfs-through-authenticated-web-proxy/

まず新しいVisual C#プロジェクトを作成する - >クラスライブラリ(.NET Frameworkの): 名:ProxyModule(例えば)。 USER、PWDとPROXYが正しい文字列値に設定する必要があります。

using System.Net; 
using System.Net.Sockets; 

namespace ProxyModule 
{ 
    public class AuthProxyModule : IWebProxy 
    { 
    ICredentials crendential = new NetworkCredential("USER", "PWD"); 

    public ICredentials Credentials 
    { 
     get 
     { 
      return crendential; 
     } 
     set 
     { 
      crendential = value; 
     } 
    } 

    public Uri GetProxy(Uri destination) 
    { 
     return new Uri("http://PROXY:8000", UriKind.Absolute); 
    } 

    public bool IsBypassed(Uri host) 
    { 
     return host.IsLoopback; 
    } 
    } 
} 

と "... \ Common7 \ IDE" フォルダに作成された "ProxyModule.dll" をコピーし、VS 2015:

C:\プログラムファイル(x86の)\のMicrosoft Visual Studioの14.0 \ Common7 \ IDE

またはVSプロ2017:

C:\ 2017 \プロフェッショナル\ Common7 \ IDE \プログラムファイル(x86の)\のMicrosoft Visual Studioの

そして、あなたが同じフォルダにdevenv.exe.configにsystem.net部分を拡張する必要があります:あなたはドントいくつかのケースでは、プロキシを使用する場合は、この方法を拡張することができ

<system.net> 
    <defaultProxy> 
    <module type="ProxyModule.AuthProxyModule, ProxyModule"/> 
    </defaultProxy> 
</system.net> 

"IsBypassed(ウリホスト)"。自分のIPをチェックしてプロキシを有効または無効にすることができます(プロキシを無効にするにはfalseを返します)。

関連する問題