C # by default, no interactive interface is provided when a Windows service is created. Neither form nor console can be displayed. However, you can enable desktop interaction in the service to start >>> run >> services. MSC> select your Windows Service> right-click Properties> log on> select allow services to interact with the desktop. In addition, you can add the afterinstall Event Response to the service Installer:
Private void serviceinstaller_afterinstall (Object sender, installeventargs E)
{
Setserviceappstopinsteract (this. serviceinstaller. servicename );
}
/// <Summary>
/// Allow service interface Interaction
/// </Summary>
/// <Param name = "servicename"> </param>
Private void setserviceappstopinsteract (string servicename)
{
Managementobject wmiservice = new managementobject (string. Format ("win32_service.name = '{0}'", servicename ));
Managementbaseobject changemethod = wmiservice. getmethodparameters ("change ");
Changemethod ["Publish topinteract"] = true;
Managementbaseobject outparam = wmiservice. invokemethod ("change", changemethod, null );
}
If ($! = Jquery) {$ = jquery. noconflict ();}