Category Archives: Windows Dev

Information related to Windows Development

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 »

Remove Misbehaving Visual Studio VSIX Extension by Force

February 27, 2023

I have been working with an extension from a software company that I could not uninstall by going through the usual Visual Studio Extensions ->Manage Extensions -> Installed screen. Ultimately I determined that the extension had a bug in the uninstaller. Face it – how much does an uninstaller get tested anyway? I followed the instructions in many… Read More »

Net.TCP Port Sharing Service (SMSvcHost)

February 28, 2023

Windows Communication Foundation (WCF) uses a Windows service called the Net.TCP Port Sharing Service to facilitate the sharing of TCP ports across multiple processes. This service is installed as part of WCF, but the service is not enabled by default as a security precaution and so must be manually enabled prior to first use.  To enable the service,… Read More »

Windows User Security Identifier – SID

March 3, 2023

Microsoft Windows security uses SIDs for authentication. This number uniquely identifies accounts on a local computer. The account name can be changed, but the SID remains the same. When a computer joins a domain, the domain controller assigns it a Domain SID for authentication purposes. Determine the Current User’s SID Open a (DOS or PowerShell) command prompt and… Read More »

Visual Studio Pre/Post Build Macros

February 28, 2023

Visual Studio allows the user to add pre-build and post-build steps when a project is built. This allows you to add custom steps to prepare the environment, copy files to installer folders, etc. By using previously defined macros, you can get build specific information. Below is an example of some. These are actually MSBuild macros and many more… Read More »

Windows Command Line Shortcuts for Services

January 24, 2023

You can open the Windows services from the command line instead of clicking around. Below are several I find most useful for my work. Your mileage may vary. Services Be sure to start services from an admin prompt if necessary. Note that you can generally ignore typing the “.msc” extension. For instance, typing “eventvwr” or “services” will start… Read More »

Starting Service Terminates with Exception Code e0434352

January 21, 2023

My goal was write a simple C# service and install it on my local machine. Installing worked fine. However, starting the service failed with this event with .NET Runtime as the source. There was another event in the log with a source of “Application Error” but it did not provide me any further information. It provided the name… Read More »

Development of Windows Services

January 31, 2023

When developing a Windows service, you spend some time on install/uninstall cycles. To manage this, you use the command line tool “sc.exe”. Get Service Information Use PowerShell to get the current running/stopped status. You can use wildcards to get related service names. Start/Stop Service PowerShell provides commands to easily start and stop services. Install Service You can install… Read More »