We help IT Professionals succeed at work.

How to stop a webservice from running

Medium Priority
48 Views
Last Modified: 2020-02-20
I have a webservice that ran with a bug in it. The web service is still running and I'd like to stop it from continuing to loop.

I am using Windows Server 2012R2 and IIS Version 8.5. It is a Windows Web Server.

I have stopped the website. I have stopped the application pool. I have waited a few minutes before restarting them.

But the webservice still keeps running in the background.

I have not reboot the box, but that is the next thing I am considering.

Any ideas? Thanks!
Comment
Watch Question

zc2
CERTIFIED EXPERT

Commented:
Why just not kill the w3wp.exe process?

If the service is the only application on the server, restart the whole IIS by executing the command "iisreset" (as Administrator).
Starr DuskkASP.NET VB.NET Developer

Author

Commented:
okay, I googled that:

At the command prompt type “taskkill /IM w3wp.exe /F”. Press Enter.

How do I start it up again though?
Starr DuskkASP.NET VB.NET Developer

Author

Commented:
oh, I was reading this about it.
https://nathondalton.wordpress.com/2013/04/15/quick-tip-how-to-kill-net-worker-process/

It says it is a task, so I was thinking, I should just be able to kill the IIS Worker Process in the task manager?

Looks like there are 3 running. But I don't know enough about it to know I'm not going to break something.

What is the IIS Worker Process?
zc2
CERTIFIED EXPERT
Commented:
Instead of standard task manager you could use the MS Sysinternals ProcessExplorer. It will show you the command line a process was started with.
For a IIS Worker Process (w3wp.exe), it contains the application pool name.
CERTIFIED EXPERT
Commented:
To get the command line parameters, you could just execute in the command prompt as administrator:
wmic path win32_process get processid,name,commandline | findstr w3wp

Open in new window

The same from the PowerShell:
Get-WmiObject Win32_Process -Filter "name = 'w3wp.exe'" | Select-Object ProcessId,Name,CommandLine

Open in new window

Starr DuskkASP.NET VB.NET Developer

Author

Commented:
Thanks! I don't know if that didn't kill the process or if I have something else going on. It's still creating the bogus records as though it is still running. So back to the drawing board.
zc2
CERTIFIED EXPERT

Commented:
When you stop a WP, it will be started again if the IIS still receives requests to the app.
Starr DuskkASP.NET VB.NET Developer

Author

Commented:
I found this method is being called elsewhere in the code, not in the webservice, so that is what is triggering the failed records also.

I'll have to publish the fix tonight and hopefully we'll be all good.

Thanks!
zc2
CERTIFIED EXPERT

Commented:
Was glad to help!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.