Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > visual studio .net debugging > september 2003 >

visual studio .net debugging : Debugger working intermittently


Tony K
9/10/2003 1:51:20 PM
We have installed Visual Studio 2003 on a Windows 2003 server machine.

When we attach a VBScript (COM object) to the debugger, it works after a
fresh reboot. But after debugging the first time the debugger won't stop at
the break point again, and the break point shows a red dot with a question
mark (which usually means the source does not match the dll.) However, when
this occurs we haven't changed the code and have not rebuilt.

We have tried rebuilding but that doesn't fix the problem. We tried
deleting the .dll and .pdb and rebuilding, and that doesn't fix the problem.
We checked to be sure we are attaching to 'wscript.exe' (it is the only one
running at the time). We have been debugging our .NET objects with
VBScript (Interop Services) since the release of Visual Studio .NET 2002 and
do not have problems debugging this code with VS.NET 2002 (Windows Server
2000 SP3).

I have seen similar behavior with ASP.NET when dllhost.exe is holding the
dll in memory and we recompile. Sometimes in VS.NET 2002 we have to KILL
the dllhost then recompile in order to get the debugger started. I don't
know if Windows 2003 or VS.NET 2003 might be holding the dll in memory and
we need to release it somehow.

We have also tried launching the debugger with this code:

if(!System.Diagnostics.Debugger.IsAttached)
System.Diagnostics.Debugger.Launch();

This will sporatically work (stop at the second line) but even when it
stops, all variables appear to be out of scope (at least to the debugger)
even though we are on a break point with the variable referenced.

Any ideas would be helpful. We have searched this newsgroup and the
internet for anyone having a similar problem with .NET 2003 and found
nothing close to what I am describing.

We are out of ideas, other than to uninstall VS.NET 2003 and stick with
VS.NET 2002.

Thanks for your help!


yhhuang NO[at]SPAM online.microsoft.com
9/11/2003 9:22:37 AM
Hello Tony,

Thanks for posting in the group.

From the problem description, I can't tell exactly what happened now. I
think you could try:

After attaching the debugger , open the Modules window from the menu
Debug-Windows-Modues window. Find the name of your assembly, you will see
"No symbols loaded" on the Information column if symbols are not loaded
correctly. Right click on the name part of your assembly and selct Reload
Symbols... Then browse to the path where the pdb file is located. This will
change the Information column to "Symbols loaded". Try a breakpoint now and
see if the debugger stops at the breakpoint.

The above technique always works if you have the correct symbols.

You may also be able to place the pdb file alongside the assembly in the
GAC. You have to find the location of your assembly in the GAC starting
from a console window and traversing down using cd command. Then use the
copy
command to copy the pdb file. I have not tested if the debugger will pick
the symbols from here.

Did you meet this problem under a simpler scenario. That is to say, if you
create a simple object and call it , could you repro the problem?

If so, please post here detailed repro steps. We will test it on our side
and reply you with our findings ASAP. Please post here if you have any more
concerns.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!From: "Tony K" <tony@tksoftwareinc.com>
!Subject: Debugger working intermittently
!Date: Wed, 10 Sep 2003 13:51:20 -0500
!Lines: 42
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <OEVkHy8dDHA.3128@TK2MSFTNGP09.phx.gbl>
!Newsgroups: microsoft.public.vsnet.debugging
!NNTP-Posting-Host: pcp985054pcs.northw01.in.comcast.net 68.58.126.161
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.vsnet.debugging:3337
!X-Tomcat-NG: microsoft.public.vsnet.debugging
!
!We have installed Visual Studio 2003 on a Windows 2003 server machine.
!
!When we attach a VBScript (COM object) to the debugger, it works after a
!fresh reboot. But after debugging the first time the debugger won't stop
at
!the break point again, and the break point shows a red dot with a question
!mark (which usually means the source does not match the dll.) However,
when
!this occurs we haven't changed the code and have not rebuilt.
!
!We have tried rebuilding but that doesn't fix the problem. We tried
!deleting the .dll and .pdb and rebuilding, and that doesn't fix the
problem.
!We checked to be sure we are attaching to 'wscript.exe' (it is the only one
!running at the time). We have been debugging our .NET objects with
!VBScript (Interop Services) since the release of Visual Studio .NET 2002
and
!do not have problems debugging this code with VS.NET 2002 (Windows Server
!2000 SP3).
!
!I have seen similar behavior with ASP.NET when dllhost.exe is holding the
!dll in memory and we recompile. Sometimes in VS.NET 2002 we have to KILL
!the dllhost then recompile in order to get the debugger started. I don't
!know if Windows 2003 or VS.NET 2003 might be holding the dll in memory and
!we need to release it somehow.
!
!We have also tried launching the debugger with this code:
!
!if(!System.Diagnostics.Debugger.IsAttached)
! System.Diagnostics.Debugger.Launch();
!
!This will sporatically work (stop at the second line) but even when it
!stops, all variables appear to be out of scope (at least to the debugger)
!even though we are on a break point with the variable referenced.
!
!Any ideas would be helpful. We have searched this newsgroup and the
!internet for anyone having a similar problem with .NET 2003 and found
!nothing close to what I am describing.
!
!We are out of ideas, other than to uninstall VS.NET 2003 and stick with
!VS.NET 2002.
!
!Thanks for your help!
!
!
!
!
colin
9/17/2003 9:18:12 AM
I'm having very similar problems. Been working fine on
Windows 2000 with both VS.NET 2002 and 2003. Moving to
Windows 2003 stops breakpoints working.

I'm dubugging JScript under ASP (not .NET). I assume this
uses the same scripting engine as you for VB Script.

I managed to get dubugging working (with a lot of granting
of access rights in obscure bits of 2003) in so far as JIT
debugger comes up if an error is encounter - and it will
debug on the "debugger" statement in JScript. But it
won't work with a good old breakpoint.

Anyone got breakpoints working?



[quoted text, click to view]
yhhuang NO[at]SPAM online.microsoft.com
9/19/2003 5:25:46 AM
Hello Colin,

Thanks for your post.

We tried debugging client script on a Win2003 machine and saw the same
behavior.

You have already listed one workaround - place a debugger statement in the
client script. "debugger;" is for javascript what "stop" is for vbscript.
Both are explicit break points.

After test, we found another workaround. First browse the page. Then open
the page in VS from the "running documents" window and set break points.
Then browse the page again and it will stop at the break points.

These workarounds can be combined. First add a debugger statement at the
top of some script and browse the page. It will enter break mode on that
line & the window displayed is the running documents window. Then add break
points as needed and continue execution. It will stop at the break points.

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "colin" <colincooper@odysseyzone.com>
!Sender: "colin" <colincooper@odysseyzone.com>
!References: <OEVkHy8dDHA.3128@TK2MSFTNGP09.phx.gbl>
!Subject: Debugger working intermittently
!Date: Wed, 17 Sep 2003 09:18:12 -0700
!Lines: 84
!Message-ID: <096801c37d37$4a85ecb0$a001280a@phx.gbl>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!Thread-Index: AcN9N0qFA3mVib3pTCSp5LcIw2+teQ==
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Newsgroups: microsoft.public.vsnet.debugging
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.vsnet.debugging:3407
!NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
!X-Tomcat-NG: microsoft.public.vsnet.debugging
!
!I'm having very similar problems. Been working fine on
!Windows 2000 with both VS.NET 2002 and 2003. Moving to
!Windows 2003 stops breakpoints working.
!
!I'm dubugging JScript under ASP (not .NET). I assume this
!uses the same scripting engine as you for VB Script.
!
!I managed to get dubugging working (with a lot of granting
!of access rights in obscure bits of 2003) in so far as JIT
!debugger comes up if an error is encounter - and it will
!debug on the "debugger" statement in JScript. But it
!won't work with a good old breakpoint.
!
!Anyone got breakpoints working?
!
!
!
!>-----Original Message-----
!>We have installed Visual Studio 2003 on a Windows 2003
!server machine.
!>
!>When we attach a VBScript (COM object) to the debugger,
!it works after a
!>fresh reboot. But after debugging the first time the
!debugger won't stop at
!>the break point again, and the break point shows a red
!dot with a question
!>mark (which usually means the source does not match the
!dll.) However, when
!>this occurs we haven't changed the code and have not
!rebuilt.
!>
!>We have tried rebuilding but that doesn't fix the
!problem. We tried
!>deleting the .dll and .pdb and rebuilding, and that
!doesn't fix the problem.
!>We checked to be sure we are attaching to 'wscript.exe'
!(it is the only one
!>running at the time). We have been debugging our .NET
!objects with
!>VBScript (Interop Services) since the release of Visual
!Studio .NET 2002 and
!>do not have problems debugging this code with VS.NET 2002
!(Windows Server
!>2000 SP3).
!>
!>I have seen similar behavior with ASP.NET when
!dllhost.exe is holding the
!>dll in memory and we recompile. Sometimes in VS.NET 2002
!we have to KILL
!>the dllhost then recompile in order to get the debugger
!started. I don't
!>know if Windows 2003 or VS.NET 2003 might be holding the
!dll in memory and
!>we need to release it somehow.
!>
!>We have also tried launching the debugger with this code:
!>
!>if(!System.Diagnostics.Debugger.IsAttached)
!> System.Diagnostics.Debugger.Launch();
!>
!>This will sporatically work (stop at the second line) but
!even when it
!>stops, all variables appear to be out of scope (at least
!to the debugger)
!>even though we are on a break point with the variable
!referenced.
!>
!>Any ideas would be helpful. We have searched this
!newsgroup and the
!>internet for anyone having a similar problem with .NET
!2003 and found
!>nothing close to what I am describing.
!>
!>We are out of ideas, other than to uninstall VS.NET 2003
!and stick with
!>VS.NET 2002.
!>
!>Thanks for your help!
!>
!>
!>
!>.
!>
!
Colin
9/20/2003 3:43:15 AM
Thanks for that and the workaround. Also stops me trying
to find a fix with more setting access rights. I assume
this will feed into the next SP. Setting a breakpoint is
pretty handy for debugging .....

VS.NET 2003 was a big step up in easy debugging ASP code
from VS6. Install the product and it works. No chasing
to do lots of security setup afterwards like VS6.
Unfortunately Win2003 seems to set this back to the bad
old days. Why cannot the install set the correct security
access rights on the server - or at least tell you clearly
in a readme what to do by hand.

Regards,
Colin.

[quoted text, click to view]
yhhuang NO[at]SPAM online.microsoft.com
9/22/2003 9:12:23 AM
Hello Colin,

Thanks very much for your feedback on our product. We appreciate it very
much. For this issue, I will report it to our product group and work with
them on it. We are looking at continual improvement, and it's this kind of
feedback that let's us know what things you're trying to do, that we
haven't yet exposed for you.

Thanks again for participating the community.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "Colin" <colincooper@odysseyzone.com>
!Sender: "Colin" <colincooper@odysseyzone.com>
!References: <OEVkHy8dDHA.3128@TK2MSFTNGP09.phx.gbl>
<096801c37d37$4a85ecb0$a001280a@phx.gbl>
<WdyqI6mfDHA.2412@cpmsftngxa06.phx.gbl>
!Subject: RE: Debugger working intermittently
!Date: Sat, 20 Sep 2003 03:43:15 -0700
!Lines: 178
!Message-ID: <0b1f01c37f63$fef9f5f0$a401280a@phx.gbl>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!Thread-Index: AcN/Y/73rNGl8qA0QhO2aiE2Ip+29A==
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Newsgroups: microsoft.public.vsnet.debugging
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.vsnet.debugging:3445
!NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
!X-Tomcat-NG: microsoft.public.vsnet.debugging
!
!Thanks for that and the workaround. Also stops me trying
!to find a fix with more setting access rights. I assume
!this will feed into the next SP. Setting a breakpoint is
!pretty handy for debugging .....
!
!VS.NET 2003 was a big step up in easy debugging ASP code
!from VS6. Install the product and it works. No chasing
!to do lots of security setup afterwards like VS6.
!Unfortunately Win2003 seems to set this back to the bad
!old days. Why cannot the install set the correct security
!access rights on the server - or at least tell you clearly
!in a readme what to do by hand.
!
!Regards,
!Colin.
!
!>-----Original Message-----
!>Hello Colin,
!>
!>Thanks for your post.
!>
!>We tried debugging client script on a Win2003 machine and
!saw the same
!>behavior.
!>
!>You have already listed one workaround - place a debugger
!statement in the
!>client script. "debugger;" is for javascript what "stop"
!is for vbscript.
!>Both are explicit break points.
!>
!>After test, we found another workaround. First browse the
!page. Then open
!>the page in VS from the "running documents" window and
!set break points.
!>Then browse the page again and it will stop at the break
!points.
!>
!>These workarounds can be combined. First add a debugger
!statement at the
!>top of some script and browse the page. It will enter
!break mode on that
!>line & the window displayed is the running documents
!window. Then add break
!>points as needed and continue execution. It will stop at
!the break points.
!>
!>Hope that helps.
!>
!>Best regards,
!>Yanhong Huang
!>Microsoft Online Partner Support
!>
!>Get Secure! - www.microsoft.com/security
!>This posting is provided "AS IS" with no warranties, and
!confers no rights.
!>
!>--------------------
!>!Content-Class: urn:content-classes:message
!>!From: "colin" <colincooper@odysseyzone.com>
!>!Sender: "colin" <colincooper@odysseyzone.com>
!>!References: <OEVkHy8dDHA.3128@TK2MSFTNGP09.phx.gbl>
!>!Subject: Debugger working intermittently
!>!Date: Wed, 17 Sep 2003 09:18:12 -0700
!>!Lines: 84
!>!Message-ID: <096801c37d37$4a85ecb0$a001280a@phx.gbl>
!>!MIME-Version: 1.0
!>!Content-Type: text/plain;
!>! charset="iso-8859-1"
!>!Content-Transfer-Encoding: 7bit
!>!X-Newsreader: Microsoft CDO for Windows 2000
!>!Thread-Index: AcN9N0qFA3mVib3pTCSp5LcIw2+teQ==
!>!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!>!Newsgroups: microsoft.public.vsnet.debugging
!>!Path: cpmsftngxa06.phx.gbl
!>!Xref: cpmsftngxa06.phx.gbl
!microsoft.public.vsnet.debugging:3407
!>!NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
!>!X-Tomcat-NG: microsoft.public.vsnet.debugging
!>!
!>!I'm having very similar problems. Been working fine on
!>!Windows 2000 with both VS.NET 2002 and 2003. Moving to
!>!Windows 2003 stops breakpoints working.
!>!
!>!I'm dubugging JScript under ASP (not .NET). I assume
!this
!>!uses the same scripting engine as you for VB Script.
!>!
!>!I managed to get dubugging working (with a lot of
!granting
!>!of access rights in obscure bits of 2003) in so far as
!JIT
!>!debugger comes up if an error is encounter - and it will
!>!debug on the "debugger" statement in JScript. But it
!>!won't work with a good old breakpoint.
!>!
!>!Anyone got breakpoints working?
!>!
!>!
!>!
!>!>-----Original Message-----
!>!>We have installed Visual Studio 2003 on a Windows 2003
!>!server machine.
!>!>
!>!>When we attach a VBScript (COM object) to the debugger,
!>!it works after a
!>!>fresh reboot. But after debugging the first time the
!>!debugger won't stop at
!>!>the break point again, and the break point shows a red
!>!dot with a question
!>!>mark (which usually means the source does not match the
!>!dll.) However, when
!>!>this occurs we haven't changed the code and have not
!>!rebuilt.
!>!>
!>!>We have tried rebuilding but that doesn't fix the
!>!problem. We tried
!>!>deleting the .dll and .pdb and rebuilding, and that
!>!doesn't fix the problem.
!>!>We checked to be sure we are attaching to 'wscript.exe'
!>!(it is the only one
!>!>running at the time). We have been debugging our .NET
!>!objects with
!>!>VBScript (Interop Services) since the release of Visual
!>!Studio .NET 2002 and
!>!>do not have problems debugging this code with VS.NET
!2002
!>!(Windows Server
!>!>2000 SP3).
!>!>
!>!>I have seen similar behavior with ASP.NET when
!>!dllhost.exe is holding the
!>!>dll in memory and we recompile. Sometimes in VS.NET
!2002
!>!we have to KILL
!>!>the dllhost then recompile in order to get the debugger
!>!started. I don't
!>!>know if Windows 2003 or VS.NET 2003 might be holding
!the
!>!dll in memory and
!>!>we need to release it somehow.
!>!>
!>!>We have also tried launching the debugger with this
!code:
!>!>
!>!>if(!System.Diagnostics.Debugger.IsAttached)
!>!> System.Diagnostics.Debugger.Launch();
!>!>
!>!>This will sporatically work (stop at the second line)
!but
!>!even when it
!>!>stops, all variables appear to be out of scope (at
!least
!>!to the debugger)
!>!>even though we are on a break point with the variable
!>!referenced.
!>!>
!>!>Any ideas would be helpful. We have searched this
!>!newsgroup and the
!>!>internet for anyone having a similar problem with .NET
!>!2003 and found
!>!>nothing close to what I am describing.
Majestic
8/11/2010 4:21:59 AM
Hi,

Did this problem get sorted? i am having the same problem on windows 7 , vs2010. I am trying to call c# code form vbscript and debugger stops at vbscript bereakpoin but not on c# code.

Cheers

From http://www.developmentnow.com/g/51_2003_9_0_0_280619/Debugger-working-intermittently.htm

Posted via DevelopmentNow.com Groups
AddThis Social Bookmark Button