Skip to content

Instantly share code, notes, and snippets.

@joe-oli
Created November 16, 2020 16:23
Show Gist options
  • Save joe-oli/7095b795e7a89daed207e71a3beaedc1 to your computer and use it in GitHub Desktop.
Save joe-oli/7095b795e7a89daed207e71a3beaedc1 to your computer and use it in GitHub Desktop.
IIS Express to serve with machine-name instead of localhost (useful for Fiddler with WCF-services)
For Fiddler to monitor, the minimal you need to do is your client needs to communicate with
http://machine-name:port/TestService.svc
NOT localhost:port NOT 127.0.0.1:port
---
Your WCF-service is running on IIS Express, thru Visual Studio;
See (WCF-)Project / Properties / Web / Servers:IIS Express
Project Url: http://localhost:50122/TestService.svc
You want IIS-Express to ALSO SERVE using machine-name:
http://intel-nuc:50122/TestService.svc
The magical command (Run as Admin prompt)
>netsh http add urlacl url=http://intel-nuc:50122/ user=everyone
NB: DONT USE the full service path in the url=http://intel-nuc:50122/TestService.svc
(You will get 503 Service Unavailable)
Just use host:port/
Then Run VS- as Admin also to start VS.
NB: You may need to also edit: applicationhost.config;
location: In the visual studio solution folder there is a hidden .vs\config folder.
I added another binding (second line) with machine-name
<bindings>
<binding protocol="http" bindingInformation="*:50122:localhost" />
<binding protocol="http" bindingInformation="*:50122:intel-nuc" />
</bindings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment