Search code examples
c#.netwindows-serviceswindows-server.net-framework-version

My Windows Service setup.exe doesn't work on Windows Server 2016 machine


i created an Windows Service application on .Net Framework 4.6 and an installation setup of this project. When i compile my project in release mode, it creates setup.exe and my .msi file. Normally, in Windows 10, my setup.exe and windows service works perfectly. But when i try to run the setup.exe in Windows Server 2016, this image is emerging:

image

When i click "Accept" button, ofcourse, it cannot download the .net framework 4.7.2 on windows server 2016.

My project doesn't have any dependecies with .net framework 4.7.2 as far as i know. And i have installed first versions of nugets that i used. Can you help me?


Solution

  • Finally I fix the problem! Setup Project prerequisites was the problem. In my prerequisites net framework 4.7.2 version is selected and somehow i couldn't see this! All my solution work perfectly when I changed target .net framework in there.

    For more information: https://www.gonnalearn.com/target-version-net-framework-launch-condition-version/

    The last thing "Check the prerequisites" in this website was my solution :)