我在 Windows Server 2003 上有一个应用程序,并将其安装在 C# 中。我将应用程序安装在服务器 2008 上,但安装时出错:我尝试安装它
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Configuration.Install.AssemblyInstaller.InitializeFromAssembly()
The inner exception System.ArgumentException was thrown with the following error message: Service name contains invalid characters, is empty, or is too long (max length = 80)..
at System.ServiceProcess.ServiceInstaller.set_ServiceName(String value)
问题是我不明白它是如何工作的。