I am running the following PowerShell command:
invoke-sqlcmd -Server <servername> -Database <databasename> -Query "SELECT @@VERSION;"
On execution an error message is produced:
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
What I have tried:
I have tried running the command with a Visual Studio Power Shell Script project and using the Power Shell ISA but to no avail.
I have tried number variations of setting the PowerShell configuration files, but to no avail. I don't know what 'additional configuration' is required.
I'm using Visual Studio 2015 Update 3, Power Shell V3 & SQL-Server 2014 Developer Edition, all on Windows 7 Professional.
Has anyone any suggestions?