Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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: social.msdn.microsoft.com/Forums/en/wcf/thread/… ? Perhaps you're better off asking "how to use ServiceHost.AddServiceEndpoint without impersonation" over at StackOverflow? –  Ƭᴇcʜιᴇ007 Sep 7 '11 at 5:54

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.