How to set up runtime environment for developing and testing Windows apps?

I would like to learn how to write my own credential provider [1] but I don't want to roll out changes on my personal computer, in case I do something dumb and lock myself out. I'll also be trying out winsock to write server/client apps (e.g., a system service that'll reboot the PC when I send it a string command from a client app).

In essence, I need a safe way to execute code that might change system behavior (e.g., interact with the login UI, install services, reboot the PC -- stuff I don't want to do on my personal PC).

I can always buy a junk computer to do the development work but that's a hassle and requires a lot of time to setup.

I've worked with VMs before (Hyper-V, Virtual Box), and this seems like a good use case for it. If I blow up a VM, just restore it from a backup VM hard disk file. That said, I've never used VMs for this development purpose - have you? Is there a better way?

[1] https://learn.microsoft.com/en-us/windows/win32/secauthn/credential-providers-in-windows
If I were to do what you propose I'd buy and setup a separate (and inexpensive bare-bones) PC just for testing. With backup software for doing whole disk imaging of the boot partition(s) so if anything goes wrong, or you want to restore the PC to pre-test status.

The PC doesn't have to be a hefty beast, just enough memory and disk space to run the tests. For this I'd have two HDs installed, one for the boot and another to store disk images.

A VM might be easier for a single PC programming configuration, but some times old school setups work better in testing isolation.

Doing credential work is IMO one of the more arcane tasks in WinAPI programming, it is really easy to make an "oops!"

I also recommend using a Virtual Machine (VM), e.g. via Oracle VirtualBox.

Microsoft is offering "free" VM-Images for all popular VM solutions (VirtualBox, VMWare, etc) to get you started quickly:

https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/
Last edited on
Topic archived. No new replies allowed.