visual studio .net debugging:
I finally found the solution for this problem (at least in my case), Thanks
to MS support.
There was _one_ function with too many parameters.
Stack pointer can only hold a so-so big value, so with all this parameters,
it got too big.
Now the tricky part, if you had a huge part of code, last line was a call to
this function, You did a breakpoint on the first row, you _STILL_ got the
error, you dont need to execute the line, it just needed to be there. Eg, in
a ASP.NET page, you got Error: Cannot obtain value everywhere, just for
addressing your function (that had too many parameter) later in the code.
Solution:
Change your function to take less parameters, or consolidate your parameters
into a class so the function takes the class as a parameter.
This is the function that didnt work.
Public Function Add(ByVal productID As String, ByVal quantity As Integer,
ByVal accountNumber As Short, Optional ByVal stockKeeping As Boolean = True,
Optional ByVal quantityBackordered As Integer = 0, Optional ByVal taxPercent
As Decimal = -999999, Optional ByVal productName As String = "", Optional
ByVal cost As Decimal = -999999, Optional ByVal price As Decimal = -999999,
Optional ByVal textComment As String = "", Optional ByVal rowComment As
String = "", Optional ByVal customerPoNo As String = "", Optional ByRef
dbTrans As Object = Nothing, Optional ByVal purchaseorderComment As String =
"", Optional ByVal performInventoryLock As Boolean = False, Optional ByVal
updateIfExists As Boolean = False, Optional ByVal
bAddCreditedLinesBackToStock As Boolean = False, Optional ByVal isKickback
As Boolean = False, Optional ByVal kickbackCost As Decimal = 0, Optional
ByVal ddLinkKey As Long = 0) As Boolean
Changed it to
Public Function Add(ByVal productID As String, ByVal quantity As Integer,
ByVal accountNumber As Short, ByVal inParam As myAddRowParam, Optional ByRef
dbTrans As SqlClient.SqlTransaction = Nothing) As Boolean
with a the inParam as
Public Class myAddRowParam
Public stockKeeping As Boolean = True
Public quantityBackordered As Integer = 0
Public taxPercent As Decimal = -999999
Public productName As String = ""
Public cost As Decimal = -999999
Public price As Decimal = -999999
Public textComment As String = ""
Public rowComment As String = ""
Public customerPoNo As String = ""
Public purchaseorderComment As String = ""
Public performInventoryLock As Boolean = False
Public updateIfExists As Boolean = False
Public bAddCreditedLinesBackToStock As Boolean = False
Public isKickback As Boolean = False
Public kickbackCost As Decimal = 0
Public ddLinkKey As Long = 0
End Class
And the whole solution works again.
Regards
Fredrik Melin
Dacsa AB