I am creating a Nancy Module that will eventually be hosted inside of a Windows Service. I am currently running it inside of a WPF test application. To start the Nancy hos
Windows will prevent you from listening on ports without permission. You can either run your process as administrator, or add permission using "netsh":
netsh http add urlacl url=http://+:8080/app user=domain\user
The "+" is a wildcard so it can listen on any IP.
Normally you'd handle the latter during installation, so you may want to run as admin to debug, then make sure your installer sets the relevant permissions.
For local debugging, use
http://+:8733/Design_Time_Addresses
You can add any subdirectory you like, for example
http://+:8733/Design_Time_Addresses/myService
and debug it at
http://localhost:8733/Design_Time_Addresses/myService
without running your IDE (Visual Studio?) as Administrator.
Look this: Self-Hosting-Nancy
The Host Configuration: UrlReservations
, add under code:
var configuration = new HostConfiguration
{
UrlReservations = new UrlReservations { CreateAutomatically = true }
};
OK, you can create your host!~