I do not understand why but here it is. It seems that the cause is that my network card is configured with 2 IPs.
if in the code i specify one of the ips (like i did in question above)
listener.Prefixes.Add("http://myip1:8080/app/");
then to avoid exception i need to register it with IP-bound weak wildcard
netsh http add urlacl url=http://myip1:8080/app user=domainuser
however if i add prefix with the strong wildcard (plus sign)
listener.Prefixes.Add("http://+:8080/app/");
and register with the same wild card
netsh http add urlacl url=http://+:8080/app user=domainuser
then there is no error and i can access my app from both ip.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…