cancel
Showing results for 
Search instead for 
Did you mean: 

Visual Studio (VB.NET) hangs when monitoring a DI-Object while debugging

Former Member
0 Kudos

Hello @All!

This situation crazes me since a long time:

When debugging the code of an AddOn and monitoring a DI-Object then Visual Studio freezes for a long (felt) time and after that the code runs to...I don't know where to.

Stopping of debugging is recommended then to get normal behaviour again.

Yes: I could avoid monitoring DI-Obj. with "Mark DI Object Variable and pressing Shift+F9". Using a MessageBox instead also works even though it is annoying me...

BUT:

Often the code/VS hangs because I unintentional move the mouse over a DI Object Variable. This is because of the little menu on the code screen which opens while mouseOver a variable. This also monitors a DI-Object and VS hangs.

This REALLY annoys me because moving the mouse is a big risc on a breakpoint. I must move the mouse very carefully to stay away from DI-Objects.

I could reproduce this issue on an own DLL (but I certainly don't know if this also is the reason in SAPBobs.com-DLL).

In my DLL I've implemented a property which returns a new created object (also from that DLL) like this example:


Public Class Example
    Private _oParcel As Parcel
    Private _ParcelNo As String = ""
    Private _ParcType As Common.ParcelTypes = Common.ParcelTypes.Undefined

    Public ReadOnly Property Parcel() As Parcel
        Get
            _oParcel = New Parcel(SboCon.SboDI)
            If Not _oParcel.GetByKey(_ParcelNo, _ParcType) Then
                Throw New Exception(Common.LastError)
            End If
            Return _oParcel
        End Get
    End Property
End Class

When debugging/monitoring an object of the Example-Class the same VS-error occurs. But not when the property is implemented as a function:


Public Class Example
    Private _oParcel As Parcel
    Private _ParcelNo As String = ""
    Private _ParcType As Common.ParcelTypes = Common.ParcelTypes.Undefined

    Public Function Parcel() As Parcel
        _oParcel = New Parcel(SboDI)
        If Not _oParcel.GetByKey(_ParcelNo, _ParcType) Then
            Throw New Exception(Common.LastError)
        End If
        Return _oParcel
    End Function
End Class

Could this be the same as in SAPBobs.com-DLL?

But more important would be to avoid the hanging of Visual Studio. Any ideas?

B1 and SDK Vers. 2005 PL39

Visual Studio 2005 SP 1

Visual Basic .NET

Cheers,

Roland

Accepted Solutions (1)

Accepted Solutions (1)

Nussi
Active Contributor
0 Kudos

i had the same problem in past ! it's crazy when you move accidently over a object propertiy like orecordset.recordcount and the studio crashes.

i solved the problem with reinstalling my computer and switching to visual studio c#

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Roland Toschek,

Though I am not sure about exact cause and fix for this issue, one way is close all watch windows that are open while debugging.

When you move the mouse over this object in code, it try to expose object content. Since it is a COM object (unmanaged code), it fails. I faced this issue in VB 2003 and now it am not facing this problem in 2005. It is problem with Visual Studio.

HTH

B Ravi Shankar

Former Member
0 Kudos

Hello Ravi Shankar & David,

thanks for confirming the problem.

>

> I faced this issue in VB 2003 and now it am not facing this problem in 2005. It is problem with Visual Studio.

Do I understand this right? In Visual Studio 2005 you do not have that problem anymore?

I'm using also VS 2005 SP1 (KB926606)

But I'm using Visual Basic (not C# which don't have that issue as David stated)

Cheers,

Roland