Solved

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

Posted on 2013-11-08
13
1,106 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
  • +2
13 Comments
 
LVL 70

Expert Comment

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

Expert Comment

by:Rainer Jeschor
ID: 39635668
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
ID: 39635714
You need to ensure that the debug symbols for that assembly are loaded...
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 18

Expert Comment

by:JoseParrot
ID: 39636134
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
ID: 39638619
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 70

Expert Comment

by:Éric Moreau
ID: 39638647
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
 

Author Comment

by:leorocha
ID: 39638704
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 70

Expert Comment

by:Éric Moreau
ID: 39638730
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
ID: 39638758
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
ID: 39641838
Solid red.
0
 
LVL 96

Expert Comment

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

Accepted Solution

by:
leorocha earned 0 total points
ID: 39643184
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
ID: 39683152
Not solved, but now it doesn't matter
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
statistics basics sources 2 41
Updating a single record in forEach using C#/Entity 7 26
ModalPopup  question 22 39
Java array 10 65
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

730 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