Using localhost 127.0.0.1 sockets to communicate works when you debug, but when you go to install your UWP app its blocked! UDP sockets UDP isn’t permitted from UWP app to UWP app (stated here – “The UDP protocol is not supported”.) In our testing, UDP client is possible, if you use the telerik AppContainer Loopback […]
All posts by
.Interprocess communication (IPC)
Microsoft guidance https://learn.microsoft.com/en-us/windows/uwp/communication/interprocess-communication
Close application
Normal method If you need to forcibly close (Where Application.Exit() doesn’t work for some reason)
.Threads
Creating a background thread Creating an accurate timer based looping background thread See here.
Stopwatch
Stopatch is an accurate timeout timer, but it doesn’t Generate Events The stopwatch timer accurately measures elapsed time.If the PC supports a high-resolution performance counter, then the Stopwatch class uses that counter to measure elapsed time. Otherwise it uses the system timer. Use the Frequency and IsHighResolution fields to determine the precision and resolution if […]
Add file to project from another project
Add as a Link Right click Project > Add > Existing Item Select the file, BUT instead of pressing the “Add” button, use the button drop-down to select “Add as Link” instead
Remote Debugging
It appears remove debugging for a standard app in Visual Studio isn’t easy like it is for a UWP app You need to copy the built exe to the remote computer every time you build the project. You can automate this by creating a post-build event in which you can do practically everything (you can […]
Drawing a chart using PictureBox
You can create simple charts by simply drawing lines and points. There’s an example of this used in this application: https://ftdichip.com/wp-content/uploads/2022/02/LibFT260-v1.1.5.zip
Conditional compilation
Because C# doesn’t use define directives like other platforms you don’t get the same compile time options based on platform target etc. The simple solution is to set a “Conditional compilation symbol” as follows In Project properties > Build Select the platform you want to detect . In “Conditional compilation symbols”, add a new symbol […]
Debugging on a remote Windows PC
Resources https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/deploying-and-debugging-uwp-apps Setting up debugging on a remote Windows PC Settings > For Developers > Turn on “Developer mode” Install the “Remote Tools for Visual Studio” on the target PC Then run Visual Studio > Remote Debugger Configuration Wizzard Follow the prompts to set the remote debugger to run. Then run Visual Studio > Remote […]