How can modify the windows service exe after its get stopped?
===

i have working in a windows application product ,here i need to replace the service exe(installation directory) for up-gradation ,so i had stopped the service and try to replace the exe by the given code

 

                ServiceController service = new ServiceController(servicename);
                                
                service.Stop();
    
                service.WaitForStatus(ServiceControllerStatus.Stopped);
                if (!sh.IsClosed)
                {
                    sh.Close();
                }
                Thread.Sleep(10000);

                System.IO.File.Copy(application.exe, newapplication.exe, true);

 , its thrown a error as given below,  

**The process cannot access the file 'C:\Program Files\Myapp\application.exe' because it is being used by another process.**

but i can sure my service dont having any dependencies ,i cannot find the way to replace the service file after getting stopped ,please help me to get out from the problem.