Debugging Windows Service Projects (C#)

Many developers find it annoying to debug the built-in Windows Service projects in Visual Studio. You can’t simply create a new project and click the “Run” button in Visual Studio and expect it to run with a debugger attached, like you can with most other project types. Normally you would install the service, start it, and attach a debugger to the process, but this is a hassle and doesn’t help much if you need to debug issues in the OnStart method.

To solve this problem and help with diagnostics, I typically add some boilerplate logic to my Windows Service projects. By passing in command line args to my service .exe, I can either have it launch in a light-weight debug console or make it wait to call the OnStart method until a debugger is attached.

Continue reading “Debugging Windows Service Projects (C#)”

Windows 7, 8, 8.1 and 10: N, K and KN Special Editions

Many MSDN customers may notice Windows editions (Starter, Professional, Ultimate, etc) that have N, K, or KN designations.  I’ve wondered what these were and if I should avoid using them.  After some research, this is what I’ve found:

Windows N: Has multimedia support removed from the OS install.  This is the version sold to the European market and is missing Windows Media Player, Windows Media Center, and Windows DVD Maker.  This was due to sanctions by the European Union (EU) against Microsoft for violating anti-trust laws.

Windows K: This edition is sold to South Korean markets and comes pre-installed with links to other competing instant messaging and media player software.

Windows KN: Is a combination of K and N.  It has links to other competing IM/MP software, but also does not include Windows Media Player, Windows Media Center, or Windows DVD Maker.

Continue reading “Windows 7, 8, 8.1 and 10: N, K and KN Special Editions”

Changes in registry startup key between Windows XP and Windows 7

Several days ago I had an issue reported where one of my applications was causing a strange folder to open when the user logged in to their computer.  My application is supposed to auto-start when the user logs in to their computer, but it was never starting on these computers – only opening a strange folder.  After doing some testing, I discovered this was happening on Windows XP machines, but not Windows 7 (and presumably Windows Vista).  I did some research and discovered that Windows XP and Windows 7 interprets paths slightly differently from the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run registry key.

Continue reading “Changes in registry startup key between Windows XP and Windows 7”

Installing Windows 7 on an HP p2-1334 Desktop PC

I had so much trouble getting Windows 7 to load on the HP p2-1334 Desktop PC.  The only OS option it comes with is Windows 8, which I actually like quite a bit, but it’s for one of the staff I work with and I didn’t feel like training them on it – plus it wasn’t the Pro edition so I couldn’t join it to the domain without upgrading.

I decided it might be nice to throw together a small tutorial on loading Windows 7, and hopefully help at least one poor soul out there. I’ve also read complaints about not being able to change the boot priority (despite the fact that this is an option in the BIOS), which I will also address here.

Continue reading “Installing Windows 7 on an HP p2-1334 Desktop PC”

Hide Welcome Screen Users posted to GitHub

If anyone has a suggestion for a better name than “Hide Welcome Screen Users” please feel free to drop me a line :).

Basically it’s just a very small tool written in C#/.NET that allows you to hide users from the Welcome Screen in Windows Vista, Windows 7, Windows Server 2008, and Windows Server 2008 R2.  I needed to create several users that performed system tasks, and it was annoying to see them on my Welcome Screen every time I booted up.  There’s an easy way in the registry to prevent specific users from showing up there, so this tool is basically just a small tool that edits those registry keys.

It’s checked in at: https://github.com/aplocher/Welcome-Screen-Hide-Users.  Please let me know if you find any issues with it.