You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a .NET 8 Application executing a lot of Powershell commands, but when I build it as a SingleFile it throws an exception.
Issue is already documented in #13540
I also opened an issue in the dotnet repo, which is to find under: dotnet/runtime #102193. There is already a very helpful comment which shows a possible way fixing the issue: Comment
Publish works, but application doesn' t run. At the first execution of a powershell script, following exception is thrown:
ERROR: 2024-05-14T12:33:51.8318820Z - Value cannot be null. (Parameter 'path1')
at System.ArgumentNullException.Throw(String paramName)
at System.IO.Path.Combine(String path1, String path2)
at System.Management.Automation.PSSnapInReader.ReadEnginePSSnapIns()
at System.Management.Automation.Runspaces.InitialSessionState.CreateDefault()
at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(PSHost host)
at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace()
at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.Invoke()
Error details
No response
Environment data
.NET 8
Win10-x64
PowerShell.SDK 7.4.2
Visuals
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Steps to reproduce
I have a .NET 8 Application executing a lot of Powershell commands, but when I build it as a SingleFile it throws an exception.
Issue is already documented in #13540
I also opened an issue in the dotnet repo, which is to find under: dotnet/runtime #102193. There is already a very helpful comment which shows a possible way fixing the issue: Comment
dotnet publish -r win-x64 --self-contained false /p:PublishSingleFile=true
Expected behavior
Publish and run successfully.
Actual behavior
Publish works, but application doesn' t run. At the first execution of a powershell script, following exception is thrown:
Error details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: