none
Default proxy on windows services without app.Config RRS feed

  • Question

  • Hi,

    I have a windows services which have to connect to Google Analytics but it's seems to not use its app.config :

    <system.net>
        <defaultProxy useDefaultCredentials="true">
          <proxy proxyaddress="myProxyAdresse" usesystemdefault="True" />
        </defaultProxy>
      </system.net>

    so how can I do the same to ensure that it can pass through the proxy?

    thanks in advance

    Tuesday, March 21, 2017 10:58 AM

All replies

  • How did you connect to Google Analytics? To check whether it is a specific issue to Windows Service, I suggest you try your code in Winform Application.

    For another way, I suggest you try to set proxy in code.

    //first customize the default proxy
    WebProxy wproxy = new WebProxy(“new proxy”,true); 
    wproxy.Credentials = CredentialCache.DefaultNetworkCredentials; 
    //or you can construct your own credentials via System.Net.NetworkCredential
    WebRequest.DefaultWebProxy = wproxy;


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 22, 2017 4:02 AM