ironmansoftware / universal-automation

Universal Automation is the PowerShell-first automation platform.
https://ironmansoftware.com/universal-automation/
MIT License
24 stars 4 forks source link

Windows service feature broken #17

Closed dewdeded closed 4 years ago

dewdeded commented 4 years ago

The windows service feature (Publish-UDDashboard) is broken.

Doesnt work in: Windows PowerShell 5.1 on Windows 10, Windows Server 2019, Windows Server 2012 RE PowerShell Core 7 on Windows 10

UniversalDashboard.Server.exe crashes mostly, like this:

Anwendung: UniversalDashboard.Server.exe Frameworkversion: v4.0.30319 Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet. Ausnahmeinformationen: System.ObjectDisposedException bei System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean ByRef) bei System.StubHelpers.StubHelpers.SafeHandleAddRef(System.Runtime.InteropServices.SafeHandle, Boolean ByRef) bei Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.LibuvFunctions+NativeMethods.uv_async_send(Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvAsyncHandle) bei Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.LibuvFunctions.async_send(Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvAsyncHandle) bei Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.LibuvThread.PostCloseHandle(System.Action`1, IntPtr) bei Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvHandle.ReleaseHandle() bei Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvStreamHandle.ReleaseHandle() bei System.Runtime.InteropServices.SafeHandle.InternalFinalize() bei System.Runtime.InteropServices.SafeHandle.Finalize()

Other problem with this feature:

Line is 53 in UniversalAutomation\UniversalAutomation.psm1 $Script:UAServer = Start-Process -FilePath $HostProcess -ArgumentList "-NoExit -NoProfile -Command"& {$Script}"" -PassThru has a problem. It calls its self in a loop. Doesnt work in: Windows PowerShell 5.1 on Windows 10, Windows Server 2019, Windows Server 2012 RE PowerShell Core 7 on Windows 10 Can be "worked around by hard setting $HostProcess.

adamdriscoll commented 4 years ago

I'm moving the recommendation for UD to use NSSM. UA will also recommend this. Closing this issue as it will no longer be applicable.

https://docs.universalautomation.io/hosting/windows-service