1

I have this Windows service that is fetching data using .NET's Webclient. It works perfectly fine when I am debugging or running the exe

But when I install and run the service (on same computer), only then is it hitting my company filter. I get back an HTML that starts with

<html>
<head>
<title>Restricted Web Site</title>

The (F#) code in question:

let wc = new WebClient()
wc.Proxy <- WebProxy(ConfigurationManager.AppSettings.["proxy"], true, null, CredentialCache.DefaultCredentials)
wc.DownloadString("http://......")

Can I get help with brainstorming? I'll repeat that this is only failing to get the right data when this is installed/running as a Windows service (I am using TopShelf)

  • Are you running the exe and service using the same user? – CaringDev Sep 28 '17 at 21:12
  • @CaringDev I am pretty sure, yes. Also, my account is in the Admin group for my domain, and the OS is Windows 7 Enterprise – reborn programmer Sep 28 '17 at 21:54
  • 3
    Your network administrators should be able to help with troubleshooting. In particular, the firewall logs should contain some indication of why the request was blocked. – Harry Johnston Sep 28 '17 at 22:07
  • 1
    usually services run in the LocalSystem account, which actually is the domain computer account in an Active Directory. This account may have different rights at the proxy. Also each different account (including LocalSystem) has different proxy configuration. – Adrien Sep 29 '17 at 01:14

0 Answers0