Solved

Debug mode Visual Studio 2010 Class Project don't stop at breakpoints

Posted on 2013-11-08
13
1,082 Views
Last Modified: 2013-11-28
I'm developing a Class Library with Visual Studio 2010 for .NET Framework 2.0 in C#. This Class import some functions from winscard.dll.

I've a web app that uses that class (dll) so in the DEBUG tab of my project properties I select START BROWSER WITH URL and select DEBUG CONFIGURATION.

In debug mode, the browser load the start page and use one function of the Class, returns a result code but, the execution never stop at the breakpoints selected in Visual Studio so i can't debug the class code.

I've test it with a C# windows exe object and the debug functions ok.

What am I missing to configure for debug using an URL?
0
Comment
Question by:leorocha
  • 5
  • 3
  • 3
  • +2
13 Comments
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
have you just tried to press F5 after setting your "set as start page"
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
Comment Utility
Hi,
is the web app part of your Visual Studio solution?
If not afaik you would have to attach to the worker process of your web app to get the breakpoint.
0
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
You need to ensure that the debug symbols for that assembly are loaded...
0
 
LVL 18

Expert Comment

by:JoseParrot
Comment Utility
Well, please check if the PDB - debug information related to the line of code, is present and loaded, when the application links to the remote site. If not, there is no way to make the debugger to associate your source lines to executable code.

As stated by TheLearnedOne, on must load the debug symbols. Please take a look at
http://msdn.microsoft.com/en-us/library/vstudio/x54fht41(v=vs.100).aspx on how to do it.
0
 

Author Comment

by:leorocha
Comment Utility
TheLearnedOne and JoseParrot, first of all thanks for your messages. Checked that and is OK.

I've debugged various class libraries of this kind without problem, but with this dll I'm really stuffed. This is a better explanation:

I am creating a class library (dll) in C # that includes the library WINSCARD.DLL:

[DllImport("winscard.dll")]
private static extern int SCardBeginTransaction(IntPtr hCard);
.
.
.
public int ReadUI(out string strUID)
{
.
.
resCode = SCardEstablishContext(SCARD_SCOPE_SYSTEM, IntPtr.Zero, IntPtr.Zero, out hContext);
.
.
}

To test, in Project Properties at Debug tab, I select DEBUG CONFIGURATION and check START BROWSER WITH URL: "http://localhost/mywebapp/mysmartcard.aspx.

I put some break points (ex: at SCardEstablishContext sentence) and press F5 (start debugging). Then the browser is loaded with my start page. I press a button associated with the execution of the function READUI and I get a message generated by the function but the break-point in my c# code is ignored, never stop.

Perhaps the winscard.dll can't be found by the web-app? I really dont know what is happening with this proyect. With other proyects I've developed have no problem at debugging.

Sorry for my english...
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
have you tried to place a break point right at the top of your page_load event?

are you in debug or release mode (you need to be in debug)?

do you have debuggerstepthrough attributes on your methods (which prevent the debugger from entering in these methods)?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:leorocha
Comment Utility
emoreau, i don't understand.

I'm debugging the DLL not the web-app, so I put breakpoints in the class source code, and press F5, my web-page (external app) is loaded and consume some functions of the DLL.

If the external app is c# windows interfase then the debug works fine.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
is your DLL project loaded into the same solution as your web application and your reference set to this instance?
0
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
When you start the debugging session, are the breakpoints solid red, or an unfilled circle?  They need to be a solid red, in order for the debugger to break on the breakpoint.
0
 

Author Comment

by:leorocha
Comment Utility
Solid red.
0
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
Can you attach the output showing the debug symbols being loaded?
0
 

Accepted Solution

by:
leorocha earned 0 total points
Comment Utility
This output corresponds to START EXTERNAL PROGRAM (utestvuquest.exe win interfase). If I choose START BROWSER WITH URL (http://localhost/MPECmain/myvuquest.aspx) it shows nothing in the output.

'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Factory\AypDesa5\VIGATEC\RIPLEYMATICOS\PILOTO\CSharpModel\bin\utestvuquest.exe'
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\vjslib\2.0.0.0__b03f5f7f11d50a3a\vjslib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Factory\AypDesa5\VIGATEC\RIPLEYMATICOS\PILOTO\CSharpModel\bin\gxclassrDotNet.dll'
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Factory\AypDesa5\VIGATEC\RIPLEYMATICOS\PILOTO\CSharpModel\bin\GxClasses.dll'
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Factory\AypDesa5\VIGATEC\RIPLEYMATICOS\PILOTO\CSharpModel\bin\testvuquest.dll'
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\vjscor\2.0.0.0__b03f5f7f11d50a3a\vjscor.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Factory\AypDesa5\VIGATEC\RIPLEYMATICOS\PILOTO\CSharpModel\bin\log4net.dll'
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Management\2.0.0.0__b03f5f7f11d50a3a\System.Management.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\vjswfc\2.0.0.0__b03f5f7f11d50a3a\vjswfc.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Factory\AypDesa5\VIGATEC\RIPLEYMATICOS\PILOTO\CSharpModel\bin\messages.spa.dll'
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Factory\AypDesa5\VIGATEC\RIPLEYMATICOS\PILOTO\CSharpModel\bin\GxClassesWin.dll'
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\vjslibcw\2.0.0.0__b03f5f7f11d50a3a\vjslibcw.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\vjswfccw\2.0.0.0__b03f5f7f11d50a3a\vjswfccw.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Factory\AypDesa5\VIGATEC\RIPLEYMATICOS\PILOTO\CSharpModel\bin\GeneXus.Programs.Common.dll'
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Factory\AypDesa5\VIGATEC\RIPLEYMATICOS\PILOTO\CSharpModel\bin\VUQUEST.dll', Symbols loaded.
'utestvuquest.exe' (Managed (v2.0.50727)): Loaded 'C:\Factory\AypDesa5\VIGATEC\RIPLEYMATICOS\PILOTO\CSharpModel\bin\Jayrock-JSON.dll'
The thread '<No Name>' (0x1dbc) has exited with code 0 (0x0).
The thread '<No Name>' (0x1968) has exited with code 0 (0x0).
The thread '<No Name>' (0x21fc) has exited with code 0 (0x0).
The program '[8308] utestvuquest.exe: Managed (v2.0.50727)' has exited with code 0 (0x0).
0
 

Author Closing Comment

by:leorocha
Comment Utility
Not solved, but now it doesn't matter
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now