Windows service started and then stopped


I have created a windows application which runs fine and then i try to run this application as a windows service. After i start the service i got the error like below enter image description here

Below are the error log i got from the EventViewer\Application

Faulting application name: MyApp.Client.exe, version:, time stamp: 0x50fce240 Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdaae Exception code: 0xe0434352 Fault offset: 0x00009617 Faulting process id: 0x1a7c Faulting application start time: 0x01cdf7a1dcc54dc3 Faulting application path: E:\Email Service\Mobile\MyService\Main\Source\Client\Service\Service1\bin\Release\MyApp.Client.exe Faulting module path: C:\Windows\system32\KERNELBASE.dll Report Id: 2ef633e5-6395-11e2-8e41-e4115b2d2915

How can i resolve this error?

asked on Stack Overflow Jan 21, 2013 by Code-EZ

2 Answers


Its a very vague error. I can result from number of things and definitely not a code error.

  • Windows patch requires a restart. sfc /scannow on command prompt as admin.
  • The kernal.dll should normal exist on the location mentioned on the error else run the regsvr32 KERNELBASE.dll on command prompt as admin.
  • Restart your server.
  • Make sure correct framework is installed and any reference into your configs.
  • Correct service user if it was supposed to run with specific access or permission.
  • Make sure your application configuration is set to Any CPU to avoid 32bit and 64bit mismatch.
  • Make sure none of the system services are stuck in starting, if there are any easy thing to do is restart and validate or check your event logs to locate the specific issue

Ours was due to service user, wrong user was mapped which caused the issue.

Regards, Saj

answered on Stack Overflow Feb 28, 2019 by Saj

I know this is an oldie but I was experiencing this issue and couldn't find anything that was helpful so I hope this helps someone else!

The issue had to do with the sc create "YourServiceNameHere" command. When using this command you can supply the parameter type, providing the wrong value may be causing the issues.

When running the sc query "YourServiceNameHere" command, the result returned that the service was attempting to run using a shared process when it actually needed it's own.

The resolution for me was to change my command from sc create "YourServiceNameHere" type= share to sc create "YourServiceNameHere". After running the service create command with the type specified, change the output of the sc query command and shows it's running in it's own process and the service successfully starts and continues running.

I really hope this helps someone, it caused me much stress!

answered on Stack Overflow Feb 18, 2021 by technified

User contributions licensed under CC BY-SA 3.0