0

I wrote a VSTO Add-In for PPT, this extension can send notes to mobile phones in the local area network through websocket service when ppt is playing.

It may be due to security reasons. Port 8080 can only be successfully monitored when ppt is started with administrator privileges. Is there any way to solve it?

System.Net.HttpListenerException:access denied.
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
桑榆肖物
  • 73
  • 2
  • 8

2 Answers2

1

Maybe you can try granting permissions to a specific URL.

netsh http add urlacl url=http://+:80/MyUri user=DOMAIN\user

or

netsh http add urlacl url=http://+:8008/ user=Everyone listen=yes

You can check these posts to find the solution:
HttpListener Access Denied

HttpListenerException "access denied" for non-admins

Lan Huang
  • 613
  • 2
  • 5
  • Thank you for your answer. I also found a similar answer and tested it, but the service is showing 503. I use the websocket service and configure the http response. When the user accesses the service, a web page will appear and then connect to the websocket service to control the playback of the ppt and send the notes of the current page of the PPT to the client. No choice but to prompt the user to run ppt as an administrator and open this port in the firewall. Hope to find a more elegant and friendly solution later. – 桑榆肖物 Feb 14 '22 at 05:33
0

I think you need to re-design your communication layer in the add-in and service. Add-in is loaded by the host application and can't request admin privileges on its own. Instead, you may consider using any other communication mechanisms that don't require admin privileges. Actually, you are free to use any .net tools and technologies from the VSTO add-in because it is still a .net application. For example, see What Is Windows Communication Foundation.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • First of all thanks for your answer. Originally, it would be relatively simple to implement through the Internet, but considering that ordinary users prefer to click and use in a local area network environment. I have also considered that it seems that I need to write a separate application, but it will be more cumbersome to operate. – 桑榆肖物 Feb 12 '22 at 13:59