Windows服务安装失败

时间:2020-03-05 11:02:48

标签: c# .net windows-services installutil

我正在使用installutil.exe将.NET Framework软件作为Windows服务安装,但遇到以下错误

An exception occurred during the Install phase.
System.InvalidOperationException: Unable to get installer types in the C:\Users\user\source\repo\mySw\core\bin\Debug\mySw.exe assembly.
The inner exception System.Reflection.ReflectionTypeLoadException was thrown with the following error message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\Users\user\source\repo\mySw\core\bin\Debug\mySw.exe assembly's progress.
The file is located at C:\Users\user\source\repo\mySw\core\bin\Debug\core.InstallLog.
Rolling back assembly 'C:\Users\user\source\repo\mySw\core\bin\Debug\mySw.exe'.
Affected parameters are:
   logtoconsole =
   logfile = C:\Users\user\source\repo\mySw\core\bin\Debug\core.InstallLog
   assemblypath = C:\Users\user\source\repo\mySw\core\bin\Debug\mySw.exe
An exception occurred while trying to find the installers in the C:\Users\user\source\repo\mySw\core\bin\Debug\mySw.exe assembly.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Aborting installation for C:\Users\user\source\repo\mySw\core\bin\Debug\mySw.exe.
An exception occurred during the Rollback phase of the System.Configuration.Install.AssemblyInstaller installer.
System.InvalidOperationException: Unable to get installer types in the C:\Users\user\source\repo\mySw\core\bin\Debug\mySw.exe assembly.
The inner exception System.Reflection.ReflectionTypeLoadException was thrown with the following error message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback will continue. However, the machine might not fully revert to its initial state after the rollback is complete.

The Rollback phase completed successfully.

The transacted install has completed.
The installation failed, and the rollback has been performed.

问题是参考dll被分组在exe文件的不同目录中。如果我将依赖关系移到exe文件目录中,则安装正常。

有没有办法提供对dll目录的引用,以便可以保留当前目录文件夹?

0 个答案:

没有答案