Abdessalem MANAI
Abdessalem MANAI

Reputation: 59

Windows Service not updating when code changes

Hi i'm new in Windows Service c#. i followed tutorials and it works perfectly after installation.

Now my problem is when i modify the fonctionnality of the service (modifying c# code), and i uninstall & install the windows service, the functionnality remains that of the first installation.

I even restarted the PC and the functionnality and the functionality has not changed

Is there someone who had this problem?

Upvotes: 0

Views: 1951

Answers (5)

Yohanes AI
Yohanes AI

Reputation: 3621

Sometimes you may need to check the configuration manager which configuration you build. Also check the directory folder and modified date. Its helps a lot. The latest version should be the same date when you rebuild the solution. Hopefully help someone.

Upvotes: 0

TechDo
TechDo

Reputation: 18649

I had the same issue and the solution I tried is different from the marked answer.

Right click the setup project (you get a popup window). Click Configuration Manager button at top right, from Active solution configuration dropdown, check whether the selected value is Release. If it is Release then Release folder is updated on building the project; else Debug folder.

Hope this will help a few having such an issue.

Upvotes: 0

Hizbullah Watandost
Hizbullah Watandost

Reputation: 247

In order run the updated service in Windows which is created in c# follow below steps

  1. First of all stop that service in windows service manager (services.msc)

  2. Then go to build menu in Visual Studio and click on Rebuild Solution

  3. Then go to services and start the service again.

In this way the updated service will run if it is build successfully and the service is created accurately otherwise you will get Service Failure alert in Windows with specific error code.

Upvotes: 0

Morpheus
Morpheus

Reputation: 55

Right click solution > rebuild. Then run your service again.

Upvotes: 0

Rajput
Rajput

Reputation: 2607

I also had the same problem.If you are using visual studio installer, just delete the .msi and setup.exe from "XXX\Release" folder and rebuild visual studio installer project. It will recreate both files with updated code changes.

Upvotes: 1

Related Questions