Windows Process Activation Service won't Start "parameter is incorrect" (Visual Studio 2010 Profiler)

I've struggled with this one for a whole day, so here is both the problem & solution:

After profiling an ASP.NET application on Windows 7 (x64), I exited Visual Studio (possibly a crash) and installed some updates which required a reboot. When I loaded back up the ASP.NET Web Application in my Visual Studio Solution was dimmed out, and the Web & WAS services turned out to be stopped.

When I tried starting Windows Process Activation Service, I got the error "parameter is incorrect".


I tried the suggestion here and didn't have any success, so then I compared the registry entries for a working WAS service and one that wasn't. Here was that difference:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WAS\Environment

Not Working: Blank

Working: Cor_Enable_Profiling=0x0

Replacing the empty Environment value with Cor_Enable_Profiling=0x0 allowed the service to start and everything returned to normal. I believe profilers set that to 0x1 when they are profiling your application, it is possible it got deleted during the unexpected shutdown of my profiler.