473,394 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Stepping into

I have a console application which calls two library ServicedComponents.
I'm in debug mode, all the symbols get loaded but I cannot step into the
method in the ServicedComponents. I can set breakpoints, I just cannot step
into.

Am I an idiot.

VS 2003 .NET
Nov 20 '05 #1
4 1012
Hi Kevin,

Thanks for posting in the community.

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to know how to debug a
serviced component.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may need to set a break point on the code of the function to be
called.
e.g.
SolutionA has two projects(SC1(Serviced Component), TestSC(Console
Application))

[SC1]
Imports System.EnterpriseServices
Imports System.Runtime.CompilerServices
Imports System.Reflection
Imports System.Runtime.InteropServices
' Supply the COM+ application name.
<Assembly: ApplicationName("TestApp")>
' Supply a strong-named assembly.
<Assembly: AssemblyKeyFileAttribute("..\..\Test.snk")>

Namespace BankComponent
Public Interface IAccount
Function Post(ByVal x As Integer) As Integer
End Interface
<ClassInterface(ClassInterfaceType.None)> _
Public Class Account
Inherits ServicedComponent
Implements IAccount

Public Function Post(ByVal x As Integer) As Integer Implements
IAccount.Post
Return x * x ' Set Break Point at the line
' Updates the database; no need to call SetComplete.
' Calls SetComplete automatically if no exception is generated.
End Function
End Class
End Namespace

[TestSC]
Module Module1
Sub Main()
Dim o As SC1.BankComponent.IAccount = New SC1.BankComponent.Account
Dim i As Integer = o.Post(10) 'Set Break Point on the line
Console.WriteLine(i)
End Sub
End Module

Press F5 the application will run TestSC and hit the break point at the
line
Dim i As Integer = o.Post(10) 'Set Break Point on the line
Press F11 or F5 the IDE will navigate to Class1.vb(SC1) and hit the break
point at the link below.
Return x * x ' Set Break Point at the line

Please apply my suggestion above and let me know if it helps resolve your
problem.

BTW, for server activated COM+ component, you may need to attach the
dllhost.exe who host the com+ object.
http://groups.google.com/groups?hl=z...&threadm=J2WI3
ndECHA.2512%40cpmsftngxa07&rnum=4&prev=/groups%3Fhl%3Dzh-CN%26ie%3DUTF-8%26o
e%3DUTF-8%26q%3D%2522david%2Byuan%2522%2Bserviced%2Bcompon ent%26sa%3DN%26tab
%3Dwg%26lr%3D

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Nov 20 '05 #2
I forgot to mention that they were library ServicedComponents.

Yes what you mention works but in VB 6.0 I've always been able to step right
into library VB components durectly from the app.

Why can't I "step in" to a library serviced component in VB.NET VS 2003?
"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:E6****************@cpmsftngxa06.phx.gbl...
Hi Kevin,

Thanks for posting in the community.

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to know how to debug a
serviced component.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may need to set a break point on the code of the function to be called.
e.g.
SolutionA has two projects(SC1(Serviced Component), TestSC(Console
Application))

[SC1]
Imports System.EnterpriseServices
Imports System.Runtime.CompilerServices
Imports System.Reflection
Imports System.Runtime.InteropServices
' Supply the COM+ application name.
<Assembly: ApplicationName("TestApp")>
' Supply a strong-named assembly.
<Assembly: AssemblyKeyFileAttribute("..\..\Test.snk")>

Namespace BankComponent
Public Interface IAccount
Function Post(ByVal x As Integer) As Integer
End Interface
<ClassInterface(ClassInterfaceType.None)> _
Public Class Account
Inherits ServicedComponent
Implements IAccount

Public Function Post(ByVal x As Integer) As Integer Implements
IAccount.Post
Return x * x ' Set Break Point at the line
' Updates the database; no need to call SetComplete.
' Calls SetComplete automatically if no exception is generated. End Function
End Class
End Namespace

[TestSC]
Module Module1
Sub Main()
Dim o As SC1.BankComponent.IAccount = New SC1.BankComponent.Account Dim i As Integer = o.Post(10) 'Set Break Point on the line
Console.WriteLine(i)
End Sub
End Module

Press F5 the application will run TestSC and hit the break point at the
line
Dim i As Integer = o.Post(10) 'Set Break Point on the line
Press F11 or F5 the IDE will navigate to Class1.vb(SC1) and hit the break
point at the link below.
Return x * x ' Set Break Point at the line

Please apply my suggestion above and let me know if it helps resolve your
problem.

BTW, for server activated COM+ component, you may need to attach the
dllhost.exe who host the com+ object.
http://groups.google.com/groups?hl=z...&threadm=J2WI3 ndECHA.2512%40cpmsftngxa07&rnum=4&prev=/groups%3Fhl%3Dzh-CN%26ie%3DUTF-8%26o e%3DUTF-8%26q%3D%2522david%2Byuan%2522%2Bserviced%2Bcompon ent%26sa%3DN%26tab %3Dwg%26lr%3D

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Nov 20 '05 #3
Hi Kevin,

Thanks for your quickly reply!

I am researching the issue, if I have new information I will upgrate with
you ASAP.

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Nov 20 '05 #4
Hi Kevin,

After my further researching, to achieve your aim, you need to declare your
object reference as class type not the interface type.

I have succeeded to step into the Seriviced Component by declaring the
component as below.
Dim o As SC1.BankComponent.Account = New SC1.BankComponent.Account

[TestSC]
Module Module1
Sub Main()
Dim o As SC1.BankComponent.Account = New SC1.BankComponent.Account
'NOTE: at the line we declare the o as Account NOT IAccount
Dim i As Integer
i = o.Post(10) 'Set break point on the line
Console.WriteLine(i)
End Sub
End Module

[Seriviced Component]
Imports System.EnterpriseServices
Imports System.Runtime.CompilerServices
Imports System.Reflection
Imports System.Runtime.InteropServices
<Assembly: ApplicationName("TestApp")>
<Assembly: AssemblyKeyFileAttribute("..\..\Test.snk")>

Namespace BankComponent
Public Interface IAccount
Function Post(ByVal x As Integer) As Integer
End Interface
<ClassInterface(ClassInterfaceType.None)> _
Public Class Account
Inherits ServicedComponent
Implements IAccount
Private Function makedouble(ByVal x As Integer) As Integer
Return x * 2
End Function
Public Function Post(ByVal x As Integer) As Integer Implements
IAccount.Post
Dim y As Integer
x = x + 1
y = x * makedouble(x)
Return y 'Set break point on the line
End Function
End Class
End Namespace

When we are debugging the serviced component, the .PDB files or source code
used by the IDE for the SC should match the DLL configured in COM+. It
seems that you have done that. :)

You may try my suggestion and let me know the result.

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: c# newbie | last post by:
When stepping through code, to find where an error is thrown, the problem is that I have to step threw the statement that causes the error, and if it's in a class that's instantiated from the main...
2
by: John Black | last post by:
Hi, I wonder if there is any good way in debugging the code not steping into STL code, it is easy to do in normal statement, just click "step over", but when there are some STL type variable on...
5
by: pinaki_m77 | last post by:
Hi, I am trying to debug a C++ program using Microsoft VC++ IDE. The program loads a dynamic link library (dll) and later makes calls to functions inside this dll. I want to step inside the code of...
0
by: craig | last post by:
When stepping though C# code in Visual Studio, often times a line of code will cause an event handler to be run. However, it appears that the debugger will not automatically step into that event...
25
by: David C | last post by:
I posted this question, and from the replies, I get the impression that I worded my posting very poorly, so let me try this again. While debugging and stepping through this foreach loop ...
0
by: stand__sure | last post by:
Stepping into a stored procedure used to be fairly straight-forward, but after following the guidance in all 6 or so of the MSDN pages about enabling debugging of stored procedures in SQL Server...
5
by: scl | last post by:
I have an application with a .Net front end that makes calls into a series of VB6 dll's via COm InterOpt. Although everything works quite well, the main issue that I have is regarding the overall...
6
by: Alex O. | last post by:
Using VS2005, I am trying to disable stepping into the operator new calls. What NoStepInto entry should I put into the registry? I tried "operator new=NoStepInto" but it does not seem to be...
7
by: Lyn | last post by:
Is there a solution to this problem? While stepping through code (F8) it would sometimes be helpful to observe changes occurring on the affected form in the Access window. However, the current...
1
by: lothar.behrens | last post by:
Hi, I have a base class that defines a MustOverride method. In a derived implementation class I am not able to set a break point nor stepping into by a call from the base class. What would...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.