communicate by using app service isnt work on uwp platform - c#

I create the wpf app and add the UWP (Windows 10) dll and winmd files. and then use use the wpf app to open the app service, the receive app is UWP blank app, cause some requirement i need about .5 second to sent the message back to wpf app. end up the connection will canceled about less a minute. if i want sent the data to wpf app any suggestion for fast way of IPC ?
Repro project:
https://1drv.ms/u/s!AgAR-fncMacb0ugThRIsoiAXnyP31Q

Related

Is there a way to use WUApiLib API in a UWP App?

I have an UWP App, and I need to list all the pending Windows Updates for the machine where mu App is running.
I know I can use WUApiLib for doing that in a WPF App, but I am not sure it is possible to do the same thing in an UWP App.
Is it possible?
If not, there is another way in UWP for searching and listing all the pending Windows Updates in an UWP App?
Unfortunately,the WUApiLib is not supported.But there is a workaround.You can write a WPF app and package your WPF app to UWP by Desktop Bridge.Here is the Desktop Bridge document.

How to close the desktop application running in background when called from UWP app

I am working on UWP app where in I have added Fulltrust permissions to my app in order to get access to the desktop application using APpServiceConncetion. But whenever I call FullTrustProcessLauncher it creates a new instance of my desktop application under my UWP app in task manager and it looks like it consumes CPU memory for each desktop app.
How do I close/keep only one instance of desktop app when I call it from UWP?
Also How can I kill desktop application from task manager/ background when I no more require this code using c# in UWP
You are in full control of the lifetime of your desktop application process, assuming you own the code. So your process can shut itself down whenever it is no longer needed. A common good practice is to shutdown when the appservice connection gets closed (i.e. the UWP app goes away and the ServiceClosed event fires).
There is some details on this in this post (under "Handling Process Exit Scenarios - Scenario 2"):
https://stefanwick.com/2018/04/16/uwp-with-desktop-extension-part-3/

TCP/IP connection in background of UWP

Scenario. I want to make UWP(8.1/10) library (somekind of remote diagnostic of app) which works with my server. Is it possible to keep tcp/ip connection in background as long as possible?
I know about two things:
Run while minimized
Run background tasks indefinitely
But if I want to insert my library into some app and then upload it in Store, it won't work, am I right?
However, developers writing UWP apps for personal use (that is, side
loaded apps that won't be published in the Microsoft Store), or
developers writing Enterprise UWP apps, may want to use all resources
available on the device without any background or extended execution
throttling. Line of business and personal UWP applications can use
APIs in the Windows Creators Update (version 1703) to turn off
throttling. Be aware that you can't put an app into the Microsoft
Store if it uses these APIs.
Also I have read about ExtendedExecutionSession when app minimized from these questions:
Run Background Task Indefinitely in UWP
extendedExecutionSession : Can we run UWP like Desktop app without
Suspending?
But I'm still confused. So, can I make library for UWP(8.1/10) with long-running background tcp/ip connection and insert into app which will be uploaded in Windows Store?

How to communicate b/w chrome native messaging app( console ) and winforms

I have created a chrome extension with native app messaging. The native app is written in (Winforms) c#. It starts as soon as we check on to the extension. I need to show the app only when the user clicks on .exe file. So my idea is to create a console application as an Native messaging application. When the user click on extension, the console app will run in background. When the user clicks on .exe
(winforms), the Winform app will launch and communicate with the console app.
Is it the best approach i can go with? And how can i establish the communication b/w console app and winforms?

WinRT - Start an application on Windows boot?

I'm working on a Metro style application in the new WinRT (.NET 4.5) framework for Windows 8, and I was wondering if it would be possible somehow for an application (through the registry or some other means) to register itself to start up when Windows starts as well.
I haven't been able to find anything about this anywhere else, only for Windows 7 or below, with normal-style applications.
There is no way to make a Metro style application launch at boot. The user will have to invoke the application from the start screen. Metro style applications cannot be services and so launching them at boot time doesn't seem like the right approach any more than launching Microsoft Word or Adobe Photoshop at boot time would be.
Microsoft's goal with Metro-style apps is that the user is always in control. Therefore, Metro-style apps cannot activate themselves when a machine boots up. Furthermore, traditional Win32/.NET desktop code cannot interact with Metro-style apps and so cannot start a Metro-style app behind the scenes.
That said, if your app has registered itself as the handler for the rendering of its own tile, then it gets called periodically and is asked to re-render its tile's content so it should always be able to show its latest status/news/info to the user when they view their start page.
I think you could have all your star tup stuff running as a service that exposes the appropriate WinRT level connectivity. Then the user only needs to fir up the client app.
Goo separation too.

Categories

Resources