My situation: when I deploy assemblies .NET in GAC, I get errors (Cannot access to xxx.dll because is in use for another process). The IIS use those dll (assemblies).
Which is the best way (more performance,quick and safe way) or all ways to stop, start IIS 6.0 Windows 2003 ? (for C#, .NET 3.5)
options, I think:
0). First step, detect IIS installed in machine.
1). Process.Start using commands: iisreset /stop, and iisreset /start
2). Use ServiceController class for get "World Wide Web Publishing Service" ( "W3SVC" ) and do stop
controller.Stop();
controller.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(timeoutSeconds));
and do start
controller.Start();
controller.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(timeoutSeconds));
3). Process.Start using tasklist command: taskkill /IM aspnet_wp.exe /F (use w3wp.exe in Win2003)
4). another options that I don't know ??