SimplySql icon indicating copy to clipboard operation
SimplySql copied to clipboard

Could not load type 'System.Security.Principal.WindowsImpersonationContext' from assembly 'mscorlib

Open ericfran opened this issue 2 years ago • 1 comments

Hi,

PS version : 7.2x after

  • import the module
  • use Open_OracleConnection I receive this: An error has occurred that was not properly handled. Additional information is shown below. The PowerShell process will exit. Unhandled exception. System.TypeLoadException: Could not load type 'System.Security.Principal.WindowsImpersonationContext' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at OracleInternal.ConnectionPool.PoolManager3.CreateNewPRThreadFunc(Object state) at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi) at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action1 callback, TState& state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() at System.Threading.Thread.StartCallback()

[process exited with code 3762504530 (0xe0434352)]

What is the root cause ? What can be done to solve this ?

regards

ericfran avatar Aug 10 '22 06:08 ericfran

@ericfran -- this module does not currently support PowerShell 7.2 -- it only supports Windows Powershell 5.1. The module has been coded against .NET Framework and later version of PS (6+) are .NET Core. Some of the providers do work in PS7 (the MSSQL provider as far as I can tell). The option is to use the -UseWindowsPowerShell parameter (which proxies in the module from a windows powershell 5.1 session).

mithrandyr avatar Aug 10 '22 12:08 mithrandyr