none
Running Windows Service on .NET 4.0+ which is targetted for .NET 3.5 RRS feed

  • Question

  • I have a service which is built for .NET target version 3.5. I choose this as i want this to run seamlessly on Windows 7+ (As Windows 7 has .NET version 3.5 included by default). Moreover, I have modified the App.config to include support for .NET 4.0+ as well incase a system does not have it installed. 

    On a Windows 10 system (with only .NET 4.6.1 installed), i am able to install the service using InstallUtil.exe in the Framework\v4.0 folder. But the issue is, when i try to start the service, i immediately get a 1053 error. I have tried adding logs in the service constructor and also the OnStart, but those don't get executed either. Running the service on a Windows 7 system works fine. Also, re-targeting the .NET to 4.6.1 makes the service run alright on the Windows 10 system. 

    What is it that i am doing wrong? Is there a different approach required to solve this issue?

    Monday, July 2, 2018 11:52 AM