Method not found: 'System.Security.CodeAccessPermission' Method not found: 'System.Security.CodeAccessPermission'

Method not found: 'System.Security.CodeAccessPermission'

Error:

The type initializer for 'Microsoft.Data.SqlClient.SqlConnection' threw an exception.
---> System.MissingMethodException: Method not found: 'System.Security.CodeAccessPermission System.Data.Common.DbProviderFactory.CreatePermission(System.Security.Permissions.PermissionState)'.

This error can be seen if SQL Change Automation is run with Powershell Core as opposed to Windows Powershell.

Running ‘$PSVersionTable’ in your shell will return a PSEdition of either Desktop or Core and show the corresponding version.

Please refer to the documentation for the currently supported implementations:

https://documentation.red-gate.com/sca/getting-started/system-requirements/powershell-component-requirements