Posh Service fails instantly

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
This topic is 2 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Thomas_Powers
Posts: 1
Last visit: Thu Aug 05, 2021 7:26 am

Posh Service fails instantly

Post by Thomas_Powers »

Hello Support and Forum,

So we have a Powershell script compiled into a windows service using Powershell Studio 2020. The new service installs fine on all platforms, but we have one Windows 2012 R2 server that throws this exception when trying to start the service:

Service cannot be started. System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.
at ..(String )
at ..( , String[] , IntPtr& )
at ..(String[] )
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

We tried a couple other Powershell studio created services and they do the same thing, so we're pretty sure it's not the script inside the service itself.

Powershell 5.1 is on this server and all patches. We are thinking that this server is missing something that is default, but not sure what this error even means.

All other 2012 R2 servers are working fine.

All insight is appreciated
User avatar
brittneyr
Site Admin
Posts: 1649
Last visit: Mon Mar 18, 2024 1:47 pm
Answers: 38
Been upvoted: 30 times

Re: Posh Service fails instantly

Post by brittneyr »

In 2020, all packaging engines were updated to use .NET Framework 4.8.
Please try installing .NET Framework 4.8 runtime on that machine:
https://dotnet.microsoft.com/download/d ... work/net48
Brittney
SAPIEN Technologies, Inc.
This topic is 2 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.