Use CancellationToken to Make Responsive Thread.Sleep() Wait

January 30, 2024

Using a time delay based on a Thread.Sleep() is truly easy. However, if you need a pause inside code that is using a CancellationToken, be aware that if the CancellationTokenSource calls the Cancel() method, Thread.Sleep() will ignore the request. CancellationToken Aware Sleep() In the example below, we get the WaitHandle from the token and pass in delay time… Read More »

SoftPro Select IAttachment Cheat Sheet

August 8, 2023

SoftPro order can have documents attached to the folder in any collection of folders you find useful. This page will be a collection of ways to interact with attachment files, folders, and items with IronPython. This is a frequent ask so the Automation Snippets can perform logic in this area. Typical Imports including LINQ Imports These are the… Read More »

Shrink DB Files to Reclaim Disk Space

July 26, 2023

While working on a project that uses WCF to connect to an endpoint that checks SQL for my credentials, I suddenly started receiving errors from SQL Server in the Event Log reporting: The transaction log for database ‘…’ is full due to ‘LOG_BACKUP’. Then the app was stuck with the message whenever I (attempted to) start it. After… Read More »

Limit Test Explorer Runs to Specific Unit Tests

July 22, 2023

I use Unit Test projects in Visual Studio using the NuGet MSTest.TestFramework package. While most of the tests are unit tests, some are integration tests (because it is so handy to run run them in the Test Explorer, too). In the same project, I may have may both types. To separate the tests into “unit tests” versus “other”… Read More »

Stop Debug Messages from Disrupting Unit Tests

June 8, 2023

When writing code, I frequently add Debug checks to alert me that an incorrect assumption has been made. During development (debug build code), I want to know I haven’t handled a case. During production (release build code), I don’t want to interrupt the user experience. This means that for an unhandled case, the method should be written to… Read More »

Add Uninstall Logging to Inno Setup

April 23, 2023

I need to test the uninstall feature of Inno Setup scripts. The easiest way I have found to do this is to directly manipulate the registry to add the log switch on the command line. [Setup]: AppId According to the Inno help, AppId also determines the actual name of the Uninstall registry key, to which Inno Setup tacks… Read More »

Inno Setup Installation Order

August 31, 2023

Much of this information is in pulled directly from the Inno Setup Installation Order page on the web. I wanted to add a bit of additional information regarding when Inno calls pre-defined Pascal scripts. My comments are in yellow and I have added function/procedure definitions where applicable. Installation Order Once the actual installation process begins, this is the… Read More »