Windows Service Threading Continued

StuartProgramming Blog

So appropriate threading in a Windows service continued to give me issues after the last discovery of the multi-threaded timer. This time, I discovered a few additional relevant items about starting and stopping a windows service. The first problem I identified in my service is that the OnStart function MUST EXIT or the service will stay in “Starting” status and … Read More

StuartWindows Service Threading Continued

Easily integrate check-in numbers to .NET assemblies

StuartProgramming Blog

Our team finds that it is very useful to have the Subversion repository numbers included in our build assembly versions.  To accomplish this (the easy way) you can use the subwcrev tool included in TortoiseSVN and: Move your AssemblyInfo.cs file to AssemblyInfo.cs.in in all of your projects Setup your assembly number as you like in your .in file with the … Read More

StuartEasily integrate check-in numbers to .NET assemblies

Dangerous .NET Timer Setting

StuartProgramming Blog

I had an idea to set my initial timer interval to 1ms so that when this service was initialized, the timer would fire immediately. It took me a while to find out that 1ms is a short enough time to frequently have multiple threads enter the cycleTimer_Elapsed section. Make sure your initial interval is a few seconds or you will … Read More

StuartDangerous .NET Timer Setting

Return a binary file to a VB Script caller

StuartProgramming Blog

It is occasionally necessary to do some heavy computing such as image manipulation while inside a VBScript. Since script isn't suited to this purpose, the way I've accomplished this in the past is to build a c# COM complaint .dll file and reference it from the script. Then the COM file can do the real processing. The downside here is … Read More

StuartReturn a binary file to a VB Script caller

iTextSharp Split on Bookmark

StuartProgramming Blog

If you've ever needed to work with PDF files in .NET the best library without a doubt is iTextSharp. For the problem below, I needed to take a PDF file that was generated by another process and split it up by the bookmarks. Each section was to become a new PDF. The solution below is translated to the iTextSharp library … Read More

StuartiTextSharp Split on Bookmark