Why doesn't the Windows service take a screenshot? - asp.net-core

There is a console application ASP.NET Core. One of its functions, sending screenshots to a client application on another PC.
If you launch this application just by double-clicking it, everything works, but as soon as you launch this application as a Windows service, everything stops working at once.
Windows services don't have access to the screen? How do I allow them to?

Related

Recommendation for distributing an application which contains a UWP app and a WCF service

Our application does the following operations. When a user registers on a portal, the application does the following
Installs certificates to Local Machine store. Installation of the certificates is done by a Windows Communication Service (WCF)
Creates a VPN profile (using Windows.Networking.Vpn APIs)
We need to ship this app to end user which consists of an UWP App, and a Windows Communication Service. We would like the user to install this app with as few clicks as possible and the result should be that user should have UWP app installed as well as the WCF Service installed and running on his/her system. We are looking for guidance relating to the best option to distribute this app to end-users? We are open to distributing this app through Windows store or by sideloading.
Please provide your guidance after taking into consideration all the below scenarios
Update/Upgrade of UWP-Application or WCF-Service.
Uninstall scenario.
How can we distribute this application for Windows 7. (Note: We use XAML Islands to make UWP App running inside WPF)
Thank you
Sujay

establish communication between metro and desktop

I'm trying to make my store app communication with desktop app through websockets.
I know we can make metro app as a client and do WinRT way of communicating over.
For the desktop server part, i'm planning to write a dll that will contain server code and receive metro texts being sent over.
Can someone please tell if this is possible and how to write server code in a dll and if so should we be using winhttp for wbesockets in server side ?
Windows Store (WInRT) apps are executing in a sandbox which isolates them from network communication with other applications on the local machine (localhost). That being said, this protection can be disabled using CheckNetIsolation.exe. Visual Studio automatically does the same for debugging purposes, allowing you to call e.g. a web service on your local machine during development.
As for the desktop side; to communicate with web sockets client, you can make advantage of WinHTTP. There's a working example on MSDN.
Keep in mind, though, that any application communicating with localhost will not be certified for Windows Store and will require several additional steps to install it:
The Windows Store application package will need to be sideloaded since it won't be published in Windows Store.
Any desktop component it communicates with will need to be installed separately the same way as any other desktop application.
Using CheckNetIsolation.exe loopback exemption will need to be added for the Windows Store app.
If you can avoid it, I definitely suggest you don't try communicating directly with a desktop application from you Windows Store app.

Uploading data when internet is available Compact Framework

I have an application that uses cellphone data connection to communicate with a remote server over web services. However, due to the unreliability of the cell phone network the application doesn't work for as long as the cell network is down. So what I want to do is change the application to process orders directly on the device and upload the orders in the background (like a windows service) when internet is available.
Here's what I'm thinking:
2 Applications
App #1: Change the order taking application to connect to internet at application load to get all settings and save to a sdf DB. Once settings are saved locally the user can process orders and save to database.
App #2: Runs in the background constantly checking db (say every 3-5 mins) for orders and upload to remote server via WCF web service. Additionally after upload is completed updated settings are downloaded back to the device.
App #2 is what I need guidance on. On a desktop I could run a windows service however compact framework of windows mobiles doesn't appear to have a windows service type support.
Any advice?
Why run it as a separate app? In that case you'll have to do cross-process synchronization of data access to make sure that simultaneous access from both processes doesn't cause a problem. Why not create a background "service" thread inside the app itself to do data forwarding to the enterprise?

XNA UI hangs while using WCF remotely

I have an XNA client which communicates with a WCF service to operate.
The XNA application is actually a multiplayer pokergame.
When I run the WCF service locally, everything works well.
However, I lately deployed my WCF service into Azure. Now when I launch the client,
it starts OK, buttons are responsive and clickable.
The same is when I launch another client, and there is now an option to start a game
(as there are 2 players).
Again, the StartGame button is clickable for both clients.
However, once the game commences, the UI hangs and becomes unresponsive.
I can't reproduce this locally. This only happens while using the Azure service.
Note I'm not using any callbacks from the server back to the client, my client continuously polls the server and operates according that information.
Any ideas?
Solved. Problem was I had another service function being called continuously, not on a new thread. While executing locally, traffic was fast enough to overcome this.
However, running remotely caused application to hang due to the synchronous calls.

How do I control a process from a web app?

I want to interact with a running process (doing things like querying information and changing settings) through a web application. How would I accomplish this?
From a 1000 foot view, you can expose an entry point from the running application the web service can access. In the case of ASP.NET/Windows Services (or any other running .net application on a windows machine) you can create a remotable object in the Windows Service which the ASP.NET web service can call and interface with.
If I were to do this on my own I would expose an API for the application using sockets. If you wanted to geat into the real crazy stuff you could expose a SOAP interface with your application - then have a MUCH eaiser time intergrating the control of the application in C# or even PHP.
I could be more specific but need to know
what OS you are running on
what
server side language you are using
for your webpage
do you have the
ability to modify the application you
want to control?