Windows 10 Pro 64-bit
If I Run the following script section within PSS or MS ISE, no exception is thrown and it runs to completion. However if I Debug with a breakpoint set on line 2 it isn't possible to Step Into (F11) that line, or beyond, without an exception being thrown. I can successfully accomplish this with MS IDE.
Code: Select all
Write-Host 'Opening Statement - Can break here' $sqlCommand = New-Object System.Data.SqlClient.SqlCommand Write-Host 'Closing Statement - Can`t step into here during debug'
>> Debugging (SQLcommand_debug_error.ps1) Script...
>> Platform: V5 64Bit (STA)
Opening Statement - Can break here
ERROR: Ambiguous match found.
SQLcommand_debug_error.ps1 (3, 1): ERROR: At Line: 3 char: 1
ERROR: + Write-Host 'Closing Statement - Can`t step into here during debug'
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : OperationStopped: (:) , AmbiguousMatchException
ERROR: + FullyQualifiedErrorId : System.Reflection.AmbiguousMatchException
>> Script Ended
Any idea what might be causing this and how it could be worked around? I'm using SQL interaction extensively in a sizeable script and it's proving difficult to realise without access to IDE debug facilities.
The .Net Framework version is 4.7 and the System.Data assembly version is as follows:
System.Data, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089