12

I'm just wondering, why I get error during an iisreset in my development machine. When I execute the command in a Command Prompt some times it wokrs,sometimes it throws an Access Denied Error, and sometimes it throws a file not found exception.

enter image description here

If anyone finds a solution to this anoying problem, I would appreciate a hint how to get rid of it.

In the IIS I'm just hosting an .NET 4.6.1 MVC site.

CodeHacker
  • 2,127
  • 1
  • 22
  • 35

4 Answers4

10

This stupid error happens randomly and was very annoying especially when you place iisreset inside a script and assume it will do its thing; took me a while to figure it out. It is not related to the service being stopped as can be seen in this picture:

enter image description here

The only thing I use now is:

net stop W3SVC

and

net start W3SVC

Haven't had a problem since then.

Dan M
  • 4,340
  • 8
  • 20
2

I got exactly the same error time ago. Running it in German too. Take a look at this article: https://techcommunity.microsoft.com/t5/iis-support-blog/iis-reset-issue-restart-attempt-failed/ba-p/1031976

Judging from @Giorgi Nakeuri's question about the event logs. The "World Wide Web Publishing" (called only "WWW-Publishingdienst" in German) is very likely not running. You need to start it. The "Windows activity process service" fails because of the first one failing.

adelriosantiago
  • 7,762
  • 7
  • 38
  • 71
  • I think its running it happens intermitently Ill do iisreset and it shuts down then fails to start, do it again and it starts – JoshBerke Jul 21 '20 at 21:31
2

I think it says that he was unable to start the service, mainly due to a Problem with authorization. The solution of the problem can be provided in several different ways

1- Configuration causing the authorization error can be corrected applicationHost.config with XML

2- This authorization can be revoked through the Windows register. Example approach here:

https://stackoverflow.com/a/21036837/914284

3- Machine configuration can be changed in accordance with this permission. Please continue with the option that suits you :)

https://knowledge.digicert.com/solution/SO1360

i hope it will resolve

Hamit YILDIRIM
  • 4,224
  • 1
  • 32
  • 35
  • if it was authorization wouldn't it fail every time? It only fails sometimes...fails when ran from a script or even from a cmd prompt – JoshBerke Jul 21 '20 at 21:31
  • Above solution is right but the reason is that net command provides to reaching to main thread and it kills the process. That's handling the authenticity – Hamit YILDIRIM Jul 23 '20 at 21:53
0

Specifying the machine name also helps in some scenarios:

iisreset %ComputerName%
Marvin Thobejane
  • 2,010
  • 1
  • 19
  • 13