I was trying to launch an application using a windows service written in c# , VS 2015. The problem is that the application has a 32 bit dll. My machine is a 64-bit one. When I try running the windows service, I get a prompt that says "application failed to launch correctly 0xc0000142". This is what I've done till now to resolve it 1.) Changed the build and target of the project in VS15 to point to x86 2.)Loaded the 32-bit dll into dependency walker. However, I hit an issue with dependency walker 3.) Checked in System Registry editor that the value of LoadAppInit_DLLs was 0 4.) Ran the project on administrator mode
I don't face these issues if I run the windows service in Debug mode by clicking "start" in VS15. The issues occur if run installutil and then try launching the windows service by running "NET start service_name"
If the value of LoadAppInit_DLLs is 0 but still not run program correctly, you should try to reinstall your .NET Framework to newest version.
After that, open your VS2015 with command: devenv /ResetSettings in Run. Open your project and try debug again.
User contributions licensed under CC BY-SA 3.0