Communication between Windows service and applications in different user sessions - windows-services

I have the following situation:
Windows Server environment with multiple user sessions.
Windows Service is listening on well known port.
Tray application in each user session which is started automatically.
Silverlight (SL) application is running in browser and communicating with Windows Service using sockets and predefined port.
My goal is the following: user interacts with SL application, SL application communicates to Windows service using sockets and afterward Windows service should communicate to proper tray application which located in the same user session like browser that initiate call.
Communication between Windows service and tray applications is planed to be done using named pipes.
Question: how to define/transfer names of named pipes to Windows service to establish right (windows service -> tray app in correct user session) connection?

I don't find exact solution for described problem. But it is possible to use custom protocol concept.
SL application generates custom protocol links and registered application handles such links in user session. Afterwards such application can establish two-way communication with Windows Service that is listening on well-known port.

Related

Run a bot in different sessions on same server

I have an Automation Server where both the Control Room and the clients are installed. The Automation Server is accessed from another Main Server and so the Control Room. I have created some clients in the Control Room from the Main Server. I have logged in to 3 different sessions of the Automation Server and also logged in to the Clients which were created in the Control Room on the Main Server.Now, when i am trying to run a bot from the Main Server, the bot is running on the Automation Server but only in the first client logged in even if i have not selected it. Can anyone help or suggest anything about this issue?
I am expecting to run a bot from the Control Room of the Main Server into the Automation Server into the selected clients.

How debug ASP.NET Core MVC application using a mobile device?

I would like to access a debug session from my ASP.NET Core MVC application from another device. For instance, normally the iss is bound to localhost:port. How can I access this by using another network device at 192.169.0.???:port.
In other words... I want to press "F5" to start debug session. The same way I open a local browser and browse to the ISS localhost, I Would like to open a browser in another device (mobile or pc) in the same network and browse my application by network.
typing the developer machine ip from another machine does not works. By the way, typing the local ip address does not work either. It only works by typing "localhost".
Is that possible using visual studio 2017?
I think you want to use this remote debugging approach? It requires installing something on the remote server for it to work. You have to use Visual Studio so it requires a computer supporting that. Your subject says "mobile device", so I wasn't sure what you meant by that.

how to monitor shared/network printers through windows service?

I can retrieve all printers(including network printers) using windows application and also able to monitor them. I am using Print Spooler API's for them. But, if I run same code in windows service, I am not able to retrieve the network printers. Because network/shared printer will only be visible if you log in as specific Windows account and service is always login as 'SYSTEM' account.
Can we monitor these network printers using service?
Yes, you need to set the Windows Service's login as a user that has permission to manage the print queues on the server or workstations you're trying to monitor.
Select the "This Account" option on the "Log On" tab in the Services Control Panel and specify an account that has the necessary permissions.

Why ASP.NET MVC app can play music on its host only if AppPool identity is LocalSystem?

I've hacked up an ASP.NET MVC app which triggers audio playback on its host using WMPLib (COM lib for interactions with Windows Media Player). It works OK when I run it at IIS Express, but at real IIS I hear the music only if AppPool identity is set to LocalSystem. Why exactly is this happened?
As you stated, WMPLib is a service (more precisely, a component service). All service run under a local account. More informations can be found in the Component Services Management Console (comexp.msc).
As we see for this component service, only the interactive user can interact with. The network service will not be able to access it.

The application trying to connect to QuickBooks is not supported while multiple instances of QuickBooks are running.

My application Connecting to QuickBooks 2013 with QBFC 12.
QuickBooks is running on a Server
Multiple users login to the same server and run QuickBooks from the server at the same time.
Application is also running on the Server.
Application connects to QuickBooks if only ONE user is logged in to the Server and has QB running.
If any other user logs in to the server and opens QuickBooks then the application does not connect.
Message Type: ERROR
Message: The application trying to connect to QuickBooks is not supported while multiple instances of QuickBooks are running.
at Interop.QBFC11.QBSessionManagerClass.BeginSession(String qbFile, ENOpenMode openMode)
at QBFSSyncManager.OpenQBSession()
Message: The application trying to connect to QuickBooks is not supported while multiple instances of QuickBooks are running.
at Interop.QBFC11.QBSessionManagerClass.BeginSession(String qbFile, ENOpenMode openMode)
at Turbo.THUB.QBProcess.QBFSSyncManager.OpenQBSession()
Solution that I found (if it applies to your problem):
If you are running your application from within Visual Studio (any version), make sure VS is NOT running as an Administrator.
This took me hours of hair pulling, name calling, forum screaming and a broken mouse to figure out.
My application works with multiple users, each with separate computers and separate instances of QB, all working in the same QB file via network file share.
I recommend move your application to a separate computer with its own QB instance and open the QB file remotely (not by remote desktop).
A common approach is to move Quickbooks to its own machine , and then write your application such that it receives requests from the other machines. The request can be processed and some sort of message returned. The message can be either a result set or a message letting the caller know if it worked, or if there was a problem.
Without knowing more about what you are trying to do, its hard to give specific advice.

Resources