Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION 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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 3 years and 9 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.
User avatar
ALIENQuake
Posts: 112
Last visit: Mon Jan 29, 2024 7:35 am
Has voted: 4 times

Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Post by ALIENQuake »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build:
version of product: PowerShell Studio 5.7.177
Operating system:
64 bit OS:Microsoft Windows 10.0.19555

*** Please add details and screenshots as needed below. ***

- create empty Forms project, set Deploy>Build as PowerShell 7/Net Core 3.1
- compile to exe, bin output:

Code: Select all

Microsoft.ApplicationInsights.dll
Microsoft.PowerShell.CoreCLR.Eventing.dll
Newtonsoft.Json.dll
powershell.config.json
PowerShell.Core.Instrumentation.dll
PS7Net3.exe
pwrshplugin.dll
SAPIEN.PoshCoreHostWin.deps.json
SAPIEN.PoshCoreHostWin.dll
SAPIEN.PoshCoreHostWin.runtimeconfig.json
System.Management.Automation.dll
System.Management.dll
- run compiled exe, an error occurs:
Image

Code: Select all

---------------------------
PowerShell cannot be instantiated
---------------------------
Could not load file or assembly 'System.Management.Automation, Version=7.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (0x80131621)
---------------------------
OK   
---------------------------
uninstalling PowerShell 7.0.1 from the system and installing PowerShell 7.0.0 is a workaround for the problem.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Post by brittneyr »

From looking at the PowerShell GitHub page, the latest build of PowerShell (7.0.1) also updated the .Net Core version required; this is what is causing the issue you are experiencing. We are looking further into this to see what we can do and I will update you when I have more information to share.
Brittney
SAPIEN Technologies, Inc.
User avatar
ALIENQuake
Posts: 112
Last visit: Mon Jan 29, 2024 7:35 am
Has voted: 4 times

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Post by ALIENQuake »

Thanks! I hope that you see now why it's a good idea to have a self-contained deployment, even if the application folder will have 100+ dll's.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Post by Alexander Riedel »

I remember you saying that before. I hope you can appreciate that not everyone agrees with your position on that. Secondly, and much more importantly, that doesn't help a darn thing.
The first thing I did this morning was to republish a packager engine as 'self contained' with the 100's of dll's you mention. It just results in the same error message.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
ALIENQuake
Posts: 112
Last visit: Mon Jan 29, 2024 7:35 am
Has voted: 4 times

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Post by ALIENQuake »

brittneyr Any news?
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Post by brittneyr »

Build 5.7.178 was released to work with 7.0.1, but will not work with 7.0.0. We are currently in the process of coming up with a solution so this is not an issue in the future.
Brittney
SAPIEN Technologies, Inc.
User avatar
ALIENQuake
Posts: 112
Last visit: Mon Jan 29, 2024 7:35 am
Has voted: 4 times

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Post by ALIENQuake »

Thanks for the info, looking forward to it.
This topic is 3 years and 9 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.