There is no source code available for the current location

G

Guest

I have an application that is suddenly having some very strange problems. If
I step through the following code;
With AppSetting
conRules.ConnectionString = "Data Source=" & .Svr & ";Initial Catalog=" &
..DB & ";user ID=" & .User & ";password=" & .PWord & ";Persist Security
Info=True;Packet Size=4096;"
conRules.Open()
End With
I get the above error message however after clearing the message I can't
step through the code but if i press F5 the code continues to run.
If however I just run the code, the error message doesn't appear?
This seems to create another problem - all breakpoints following the above
code are ignored. It doesn't appear to matter if I step through the
offending code or put the first breakpoint after it - the code just runs
without stopping.
Even stranger, I started a new project to test the above couple of lines and
they work perfectly?
Needless to say any suggestions to correct this problem would be appreciated.
 
C

Cor Ligthert

Ray,

Two possible big changes which can give this behavioru.

Threading (not the most probably)
Recursive routines (call the procedure in itself).

This can by instance happen because you do that yourself
You have not send an end for that
You are changing in an event the reason the event is fired.

The last is the most likely

I hope this helps?

Cor
 
G

Guest

Thanks Cor however I haven't used threading or any recursive routimes in this
application. The application is pretty standard, open a datareader, loop
through each of the records and close it.
 
N

Nick Malik [Microsoft]

Hi Ray,

I missed the original message. I assume it is this one, from your title:
http://msdn.microsoft.com/library/e...ecodeavailableforcurrentlocationdialogbox.asp

The obvious cause for this is that you are debugging code that you are
compiling using the Release profile instead of the Debug profile. Now, on
to some less obvious causes, in case you already thought of that.

Is this in VS2003 or VS2005. The reason I ask: if this is in VS2005, then
the following snippet from the VS2005 readme may be interesting:
"Characters that are not used in English, such as Chinese characters, might
cause build errors when used in project names. Errors include: There is no
source code available for the current location. and InvalidManifestException
was unhandled."

Another option: do you use timers in your app? If so, see:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q329247

This problem happens periodically. Here is another thread with a similar
issue:

http://www.dotnet247.com/247reference/msgs/52/264597.aspx

If none of this helps, know that this has happened to me as well, once, when
using VS2002. At the time I was stumped and couldn't figure it out. After
banging my head against it for three hours, I kinda cheated. I created a
new project, and added all of the existing .cs files into it. Problem
disappeared. I still can't figure out why it happened, but I'm not exactly
obsessing about it either.

I hope some of this is helpful to you.


--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top