开发者

.NET (VB): Runtime is initializing a variable to an Instance of the wrong class

开发者 https://www.devze.com 2023-01-09 03:42 出处:网络
Something is munged-up here, I just don\'t know what.I\'ve got some code that looks like this: If ediFileGroupAbbr = \"NIPDSINV\" OrElse ediFileGroupAbbr = \"WWPDSINV\" Then

Something is munged-up here, I just don't know what. I've got some code that looks like this:

If ediFileGroupAbbr = "NIPDSINV" OrElse ediFileGroupAbbr = "WWPDSINV" Then
    Dim p As New PrivateBillingAdapter_ForN(ediFileGroupAbbr, businessLocationID, mode, EDIJobItemLogID, BusinessUnitID)
    Return p.ProcessEDI(True, False)
ElseIf ediFileGroupAbbr = "FOPDSINV" Then
    Dim p As New PrivateBilling开发者_如何学PythonAdapter_ForF(ediFileGroupAbbr, businessLocationID, mode, EDIJobItemLogID, BusinessUnitID)
    Return p.ProcessEDI(True, False)
Else
    Dim p As New PrivateBillingAdapter(ediFileGroupAbbr, businessLocationID, mode, EDIJobItemLogID, BusinessUnitID)
    Return p.ProcessEDI(True, False)
End If

to which I'm passing in a value of ediFileGroupAbbr = "FOPDSINV". But the code is executing as if it's dropping into the third condition (p is a PrivateBillingAdapter). So I've stepped into the code and, sure enough, it drops into the second condition. BUT, if I step into the execution of the constructor, the debugger jumps to an odd place in the code - sort of the middle of a method and not on any actual line of code.

A couple clicks and it hops back out of the constructor, still in the second block of code. But if I mouse over the variable p to see it's type, boom, its a PrivateBillingAdapter (from the third block).

Like I said, something is clearly wrong but I don't know what. I've tried rebuilding several times but with no new results.

This is VS2003, framework 1.1 with VB.NET.


DLL's were just out of sync amd not updating as expected. I forced a delete of the out of sync assembly and rebuilt, and it's acting correctly now.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号