<p>I have two windows services running on the same machine. Both the services uses</p>

<p>private HttpListener listener;</p>

<p>I specify the baseURL as "<a href="http://IPAddress:8080/" rel="noreferrer">http://IPAddress:8080/</a>" &amp; "<a href="http://IPAddress:8081/" rel="noreferrer">http://IPAddress:8081/</a>" respectively for each of the services. Then I do the needful and call</p>

<p>listener.Start();</p>

<p>The first service starts successfully at 8080 port. But when I now start the 2nd service,
I get HTTPListenerException "The process cannot access the file because it is being used by another process" for listener object.</p>

<p>Could anybody please tell me:
1) If it is possible to start two HTTP listeners on the same IIS at two different ports.
2) If yes, how can we achecive this?
3) Is there any other way of doing this?</p>

<p>For your information:
I am using C#.NET 2.0 and IIS 6.0 server.</p>

<p>Thanks &amp; Regards,</p>

<p>Hari</p>

Doesn't HttpListener work independently from IIS? Can you stop the IIS service and see what happens?
Or maybe port 8081 is
used by another program
or process. I suggest to try to set the port to another number. You could open a command line and execute the "
netstat
" command to see
if the port is used
before starting your services.
(source:
googlepages.com
)