-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some windows 10 and windows 11 clients can't connect to the PipeServer if hosted in a service #14
Comments
Hello. I want to note that the code in the service runs with administrator rights. However, if you run pipeServer in a normal application, it also needs administrator rights to work correctly |
You may also need to set up more advanced permissions. AllowUsersReadWrite makes this easy for the easy case public static void AllowUsersReadWrite<T>(this IPipeServer<T> server)
{
server = server ?? throw new ArgumentNullException(nameof(server));
server.AddAccessRules(
new PipeAccessRule(
new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null),
PipeAccessRights.ReadWrite,
AccessControlType.Allow));
} |
I have the service running as administrator, however, it doesn't accept a connection, is there a way to "trace" the accept/ deny access as I have no luck in the windows event logs and not on any of the events. Remember, the same class that hosts the service is used in a winforms app and runs without any issues, same users same pc. |
Another idea: perhaps you have some kind of resource cleanup problem (because Dispose is required after pipes is finished), and when creating a new server inside the service, an exception is thrown that the name is already taken? Try to subscribe to all events that the server issues and log them |
I wrote a small test-rig allowing you to get some code to reproduce ... the issue is that the test works on the client machines... there must be a difference not sure where... the sample code I generated Not sure if my code is "standard" BackgroundWorker2022030712.txt |
looks like, depending on the frameworks installed on the target machines the code fails.
Also, some code that only executes on windows is interweaved with platform generic code making it windows only. |
I met some issues with .Net 6 and .Net Standard. I can try adding an explicit .Net 6 TargetFramework and see if that gives the desired result. |
Perhaps also have a look at public async Task StartAsync(CancellationToken cancellationToken = default) |
It transmits, but only through an |
Perhaps NET6_0_OR_GREATER |
It will also explicitly throw an exception if it fails to create a server |
|
These exceptions will be received here: H.Pipes/src/libs/H.Pipes/PipeServer.cs Lines 242 to 251 in f5372ff
|
https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting |
However, I've added explicit .Net 5/.Net 6 frameworks (for the ability to call the |
I have a service that would need to accept client data that runs without elevated permissions
I use this code
My developer machine can connect just fine, some other machines however can't. If I take the NuGet package where I wrapped the PipeServer and PipeClient in and create a chat app using Winforms that same machine accepts the client without any issues, both are .net 6.0
If I take the Production client and have it connect to the Winforms test service all seems to work well.
The only difference is that one is hosted in service, the other is in a normal WinForms, with no changes made to the machines that are being problematic.
What am I doing wrong, how can I solve the issue?
The text was updated successfully, but these errors were encountered: