Running an application as a windows service (Alternative to srvany)

Until recently, when I wanted to set up a non-service application to run as a windows service, I always used srvany.exe. One of the problems with srvany is that it can’t detect if the application has crashed and therefore continues to report that it is still running. Since it doesn’t know when the application stops, the service manager doesn’t know to attempt to restart it. In its place, I’ve started using a utility called nssm.

Sharing Build Configuration Settings Between Project Files

Update: Oh snap… nCrunch isn’t smart enough to pull in the external configurations like this, and so it won’t run any of my tests. Gotta find plan B. As we’ve added new projects to our solution and new build environments, it has become increasingly difficult to maintain consistency in our settings across all projects. Here is how we addressed it. Added a new MSBuild target file (CommonBuildConfigurationSettings.target) to the solution to contain these settings.

Patterns of Enterprise Application Architecture Quote: Separating Domain Logic

"One of the hardest parts of working with domain logic seems to be that people often find it difficult to recognize what is domain logic and what is other forms of logic. An informal test I like is to imagine adding a radically different layer to an application, such as a command-line interface to a Web Application. If there’s any functionality you have to duplicate in order to do this, that’s a sign of where domain logic has leaked into the presentation.

Selenium WebDriver: PageObjects Pattern

As you increase the number of functional tests against your site, you will find a lot of duplicate code. This increasingly makes maintenance difficult because a single UI change will require many changes across the tests. In response, Selenium has suggested the PageObjects pattern which represents each page on your site as an object. The details of interacting with a page is moved out of the test and into the page object.

Properly disposing WCF Proxies

I always thought the best practice for using a WCF Proxy, which implements the IDisposable interface, was like this: <p> <!--CRLF--> </p> <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2"> 2:</span> {</pre> <p> <!--CRLF--> </p> <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3"> 3:</span> .