Can you tell me how to do this so that the WCF application does not require administrator rights to run? Specifically, here is my server, a TCP connection, but if you do not press the launch from the admin, it writes something about the lack of rights and falls off. And I will have to run it on the Univers computers (on the local network), where they refuse to give me admin rights, they say they themselves have none.
- Maybe the port number is wrong? Less than 1024 can only be used by the admin. - Sergey
- @Sergey no, I think that this is most likely due to Mex-Http. - PECHAPTER
- I do not remember what this fur is, but I remember that in netsh I had to prescribe something. - Sergey
- @Sergey mex is a thing that broadcasts service data. Well, that is in fact, its source code or, more precisely, only prototypes ... In any case, as I myself understood. This is necessary in order for the client to automatically generate code for the proxy. And since this mex transmits via HTTP, it seems to me because of it and admin rights are required. TCP should not require them in theory. - PECHAIRTER
|
3 answers
The problem is solved by removing everything connected with Mex from the config.
- So this is not an addition. This is a solution. - PECHAPTER
|
Set the portSharingEnabled setting to false for bindings:
<system.serviceModel> <bindings> <netTcpBinding> <binding portSharingEnabled="false" /> </netTcpBinding> </bindings> </system.serviceModel> After that, WCF will return to the old “one application per port” model, in which it is not necessary to assign rights to the ports.
- No, that did not help. - PECHAIRTER
- Hmm, then it's about something else ... - Pavel Mayorov
- Can't be a mex problem? - PECHAPTER
- Well, check it out. - Pavel Mayorov
- Riley !!! In mex, it was a deal! He removed, no longer require admin panel. - PECHAPTER
|
Once the service requires the right, apparently, you are using a duplex connection. So you must allow the opening of the port to your user.
This is done from under the admin command line:
netsh http add urlacl url=http://+:1234/YourServiceURI user=YOURDOMAIN\youruser Replace 1234 with a real port number, YourServiceURI with the name of your service.
Reading by topic:
- Microsoft Documentation: WCF Feature details / Transports / Configuring HTTP and HTTPS
- The same programmatically: WCF selfhosted service, installer class and netsh
- I said that I do not have access to admin rights on the computer being started. - PECHAPTER
- @DarkByte: No admin rights to install - no way. Ask the admin to open this port for you, let him run the script himself. - VladD
- but why when I wrote simply through winsock with ordinary sockets I didn’t need any administrator rights, but they are required ??? - PECHAPTER
- @DarkByte: Because you seem to be using a duplex connection. - VladD
- @VladD and what is it? : D I do not seem to use it. - PECHAPTER
|