VB.NET tries to execute comment

  • Thread starter Thread starter Ralfs
  • Start date Start date
R

Ralfs

It would be very long explanation, I'll try to keep it
as short as I can.

Stepping through the code I get SqlConnection error with
data adapter. Wish to see what is it.
Fine, I surround it by Try...Catch ...End Try. On the line
where da.Fill(dt) was now is "Try". Stepping through stops
on Try with the same SqlConnection error. "Try.Catch.End"
are commented out now. Stepping through the code stops
on the commented "Try" with the same error.
I have a screenshot, don't know how to post it. Would be
nice if someone from Microsoft responded, I don't want
to waste my time and open incident.

Ralfs
 
Hi Ralfs

If it is any consolation, I have this happen occasionally as well. I can
usually get rid of it by rebuilding. It seems that the IDE gets out of sync
with the compiled code. Does your solution contain multiple projects? This
is the scenario when I see it in my code. Try checking the dependencies
carefully, and make sure you don't have circular references. Although VS
does let you do it I think this can upset it. [Also it's bad OO].

HTH

Charles
 
* "Ralfs said:
Stepping through the code I get SqlConnection error with
data adapter. Wish to see what is it.
Fine, I surround it by Try...Catch ...End Try. On the line
where da.Fill(dt) was now is "Try". Stepping through stops
on Try with the same SqlConnection error. "Try.Catch.End"
are commented out now. Stepping through the code stops
on the commented "Try" with the same error.
I have a screenshot, don't know how to post it. Would be
nice if someone from Microsoft responded, I don't want
to waste my time and open incident.

Make a rebuild of the application. If this doesn't help, delete its
"bin" and "obj" folders and build it again.
 
Hi,
I see I'm not alone. Well, solution has 4 projects and
I'm checking the refs right now. Some observations when
this effect is likely to show up are:

1. Usage of COM object references
2. Variable is declared as Shared (any part of solution)
3. Office COM Add-in type of executable

I still cannot pinpoint what exactly I do but I see this
too frequently. It is somewhere in IDE, closing and
re-opening solution doesn't help, rebuild all doesn't
either. Closing the whole IDE will allow to change code and
compile correctly one time and after it IDE is stuck
on the same line in code. So far no way to get rid of it.
Just "New project/add existing item..." and until the
next bug visit.

Ralfs
-----Original Message-----
Hi Ralfs

If it is any consolation, I have this happen occasionally as well. I can
usually get rid of it by rebuilding. It seems that the IDE gets out of sync
with the compiled code. Does your solution contain multiple projects? This
is the scenario when I see it in my code. Try checking the dependencies
carefully, and make sure you don't have circular references. Although VS
does let you do it I think this can upset it. [Also it's bad OO].

HTH

Charles


Ralfs said:
It would be very long explanation, I'll try to keep it
as short as I can.

Stepping through the code I get SqlConnection error with
data adapter. Wish to see what is it.
Fine, I surround it by Try...Catch ...End Try. On the line
where da.Fill(dt) was now is "Try". Stepping through stops
on Try with the same SqlConnection error. "Try.Catch.End"
are commented out now. Stepping through the code stops
on the commented "Try" with the same error.
I have a screenshot, don't know how to post it. Would be
nice if someone from Microsoft responded, I don't want
to waste my time and open incident.

Ralfs


.
 
I had this problem more often with VS2002. Haven't had it yet in 2003.

The code in the IDE is newer or different from the compiled code the
debugger is attatched to, so the execution lines don't match up. You have a
stale component or exe somewhere.

-- russ
 
Back
Top