Home > Net >  An exception occurs when using AssemblyInstaller unloading service
An exception occurs when using AssemblyInstaller unloading service

Time:11-19

Are unloading assemblies "D: \ CrossEcom \ CrossEcom \ CrossEcomWin \ bin \ Debug \ CrossEcom exe",
Affected by the parameters are:
Assemblypath=D: \ CrossEcom \ CrossEcom \ CrossEcomWin \ bin \ Debug \ CrossEcom exe
Logfile=D: \ CrossEcom \ CrossEcom \ CrossEcomWin \ bin \ Debug \ CrossEcom InstallLog
Is removing the EventLog source CrossEcomService,
Warning: the source CrossEcomService not registered on the local computer,
Is removed from the system service CrossEcomService...
In the unloading System. ServiceProcess. ServiceInstaller exception occurs during the process of installation,
System.Com ponentModel. Win32Exception: the specified services not installed,
Abnormity in the process of unloading, will ignore the exception and continue to unload, but, after uninstalling the application may not completely uninstall,

CodePudding user response:

CodePudding user response:

Is there a master to help look at what the problem ah

CodePudding user response:

For service in general need to stop the service before the unloading

CodePudding user response:

reference wanghui0380 reply: 3/f
for service generally need to stop the service before unloading the

Stopped to unload the same abnormalities

CodePudding user response:

 public static void UninstallService (string ServicePath) 
{

TransactedInstaller TransactedInstaller=new TransactedInstaller ();
AssemblyInstaller AssemblyInstaller=new AssemblyInstaller (ServicePath, new string [] {});
TransactedInstaller. Installers. The Add (assemblyInstaller);
TransactedInstaller. Uninstall (null);
TransactedInstaller. The Dispose ();
}


Look at this, this is my own use, running wood problem, if the wrong, you can check the path

CodePudding user response:

Advised to restart the machine in the debugging, the system of service uninstall exception will make a mark, waiting for next time starts in processing, use if there is a problem, can look after the restart

CodePudding user response:

refer to 6th floor wanghui0380 response:
advised to restart the machine for debugging, the system of service uninstall exception will make a mark, waiting for next time starts in processing, can use if there is a problem, restart after watching

Restart or this exception, when I was in want to uninstall before will not stop first, and then to uninstall the first part, and then back unloading, some in the previous step be uninstalled, so can't find the uninstall, this may be?

CodePudding user response:

Restart the computer is a good thing,,, I restart the service did not have,,,

CodePudding user response:

Stop service to wait for a moment to stop, the.net services need to be smooth closed, if you update the assembly at this time, will be submitted to the errors in the use, have to wait a minute, don't like go, smooth closing all from already do,. Net prepared for you, you also need to know about it,

CodePudding user response:

And unloading service, I usually use InstallUtil. The discharge of the exe run CMD command,

CodePudding user response:

Dynamic hot update service, it is suggested that using the.net framework of MEF,

CodePudding user response:

For complex tasks, don't be too bottom, must begin from the top, and the use of libraries over the years there have been mature

CodePudding user response:

"Bottom" to write their own code, what do you think of uninstalled, but the memory is still there, or even to the cache clearing the.net runtime environment, to identify the new version of the. DLL library, compatibility is very bad,
  •  Tags:  
  • C#
  • Related