6

IIS 10 will not restart on my PC. When I navigate to localhost, I get a 'localhost refused to connect' message. After looking through the event viewer, it turns out that the issue is that the Windows Process Activation Service (WAS) will not start.

The error message given is:

'The Windows Process Activation Service (WAS) encountered an error while handling key generation. This will prevent WAS from starting corrently. The data field contains the error number.'

When I try to start the service manually from the services app, I get the following:

WAS error

Has anyone experienced this issue before? Any help would be greatly appreciated, I've been trawling the internet for several days trying to find a solution to no avail.

Cameron
  • 213
  • 1
  • 3
  • 9

3 Answers3

27

We've run into this issue several times after recent Windows Updates. In all cases, the following worked (got from a Microsoft support rep):

Run the following from an admin Powershell prompt:

reg delete HKLM\SYSTEM\CurrentControlSet\Services\WAS\Parameters /v GenerateKeys /f
net start w3svc

The keys will be regenerated, then the IIS AppPools can be started

user2088457
  • 383
  • 3
  • 6
  • Unfortunately I ended up reinstalling Windows 10 to resolve the issue. But thanks for your reply – Cameron Oct 20 '20 at 15:47
  • 1
    thank you this have worked for me, i had the exact same problem, been looking forward to a solution. – travs15 Jan 14 '21 at 16:59
  • 1
    After hours of searching, this fix worked for me, many thanks kind internet stranger. – DevSolo Feb 13 '21 at 14:27
  • i run the first line, and finally WAS is strated – ahmad molaie Feb 23 '21 at 14:02
  • I had the error WAS 5217. I tried to delete MachineKey files https://serverfault.com/questions/554788/missing-machine-key-in-iis-manager but that doesn't work. Using that commands fix my issue – mems Mar 06 '23 at 11:33
1

According to your error message, WAS can not access the machine key when start up. Usually, machine keys are used to encrypt sensitive information in config file, WAS will not be able to start if there is no machine key to use.

The easiest and most common method is to try to uninstall and reinstall WAS.

If it still can not start, try to delete the registry entry NanoSet with cmd.

If the above two methods are useless, you can refer to this to delete machine keys, let WAS create new one while starting.

Bruce Zhang
  • 2,880
  • 1
  • 5
  • 11
  • Thanks for the reply. Reinstalling WAS did not work. I searched for the NanoSet registry entry in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WAS\Parameters\ and it does not exist – Cameron Sep 02 '20 at 09:01
  • Then I suggest you delete the machine key. This method is used by most people and is a more effective method. – Bruce Zhang Sep 03 '20 at 01:22
0

If somebody is still fighting with this issue, please check Event Viewer under System filter and check for any logs related to WAS. In my case I found the following entry:

The Windows Process Activation Service (WAS) encountered an error while handling key generation. This will prevent WAS from starting currently. The data field contains the error number.

So I just started again CNG Key Isolation service and everything is working now.

Toni
  • 1,555
  • 4
  • 15
  • 23
akowalew
  • 48
  • 4