Debug Exception when using System.Data classes

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
datacore.glenn
Posts: 30
Joined: Mon Apr 09, 2012 1:45 am

Debug Exception when using System.Data classes

Post by datacore.glenn »

PowerShell Studio 2017 v5.4.142
Windows 10 Pro 64-bit

Hello Support,

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
ERROR:
>> 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:

> $type.Assembly.ImageRuntimeVersion
v4.0.30319

> $type.Assembly.Location
C:\WINDOWS\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll

> $type.Assembly.FullName
System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089


Thank you,
Glenn

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Debug Exception when using System.Data classes

Post by davidc »

Thank you for reporting this. We are aware of the issue and it will be resolved in the next service release (coming soon).
David
SAPIEN Technologies, Inc.

User avatar
datacore.glenn
Posts: 30
Joined: Mon Apr 09, 2012 1:45 am

Re: Debug Exception when using System.Data classes

Post by datacore.glenn »

Thank you, appreciated.

Glenn

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Debug Exception when using System.Data classes

Post by davidc »

Please try the latest service build (v5.4.143) and let us know if the issue is resolved.
David
SAPIEN Technologies, Inc.