Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a C# (WPF) application (my own creation) that needs to open a port on the computer. This means that it requires administrative privileges to run. The app is currently unsigned and every time I run it it brings up the UAC prompt inquiring whether I want to let this program from an unknown publisher make changes to my computer.

I was wondering why Firefox doesn't trigger a UAC warning. After all, it too must open a port to be able to access the internet. Is it because Firefox is a native app?

share|improve this question
Are you sure the UAC prompt is because your program is trying to "open a port" and not because it's doing something else? If you disable the firewall, do you still get a UAC prompt? – Ƭᴇcʜιᴇ007 Sep 7 '11 at 3:33
@techie007: The UAC prompt is because I've set requestedExecutionLevel level="requireAdministrator" in the app manifest. I had to do this because I use ServiceHost.AddServiceEndpoint to open the port, and this call fails unless the app is run as administrator. – Praetorian Sep 7 '11 at 5:41
Ahhhh.. Have you seen this:… ? Perhaps you're better off asking "how to use ServiceHost.AddServiceEndpoint without impersonation" over at StackOverflow? – Ƭᴇcʜιᴇ007 Sep 7 '11 at 5:54
up vote 3 down vote accepted

Your program opens a port for listening for incoming connections. Firefox does not do that – it connects to a server.

Outgoing connections do use an ephemeral port locally too, but it is opened implicitly for just that specific connection (see stateful firewall).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .