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.
User avatar
ALIENQuake
Posts: 50
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Sun Mar 03, 2013 12:45 pm

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: 428
Joined: Thu Jun 01, 2017 7:20 am

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 Ryn
SAPIEN Technologies, Inc.

User avatar
ALIENQuake
Posts: 50
Joined: Sun Mar 03, 2013 12:45 pm

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: 7343
Joined: Tue May 29, 2007 4:43 pm

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: 50
Joined: Sun Mar 03, 2013 12:45 pm

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

Post by ALIENQuake »

brittneyr Any news?

User avatar
brittneyr
Site Admin
Posts: 428
Joined: Thu Jun 01, 2017 7:20 am

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 Ryn
SAPIEN Technologies, Inc.

User avatar
ALIENQuake
Posts: 50
Joined: Sun Mar 03, 2013 12:45 pm

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

Post by ALIENQuake »

Thanks for the info, looking forward to it.