473,407 Members | 2,312 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,407 software developers and data experts.

.Net dynamic call and debuging issue

Tom
Hi .Net Professional :

In recent , I starting to learn about dynamic call .net object in vb.net.

Before, some IT people teach me use the following method and its work !!

Dim asm As [Assembly] =
[Assembly].LoadFrom("D:\vb7Project\dynamicCall\prj01\prj01\b in\prj01.dll")

Dim ty As Type = asm.GetType("prj01.dbLib")
Dim obj As Object = Activator.CreateInstance(ty)
obj.SendMsg()

However, I have face another problem : debug in runtime, I find that it can
allow me trace the program during runtime, e.g. I add breakpoint in the
child object. It will not show it. Therefore, how can I fix it. Actually , I
cannot change the dynamic design into static design(i.e. add reference to
project in design time).

Thanks for your help
..Net student


Nov 21 '05 #1
4 2017
What do you mean by not allowing breakpoint in child object. Do you mean in
the SendMessage line of inside the object that you are creating. If you want
to debug the object you are creating, you just need to step into the code and
it should be able to debug. Otherwise, open that project(the dynamic code
one) and attach to the caller process and debug.

Rgds,
Anand
http://www.dotnetindia.com

"Tom" wrote:
Hi .Net Professional :

In recent , I starting to learn about dynamic call .net object in vb.net.

Before, some IT people teach me use the following method and its work !!

Dim asm As [Assembly] =
[Assembly].LoadFrom("D:\vb7Project\dynamicCall\prj01\prj01\b in\prj01.dll")

Dim ty As Type = asm.GetType("prj01.dbLib")
Dim obj As Object = Activator.CreateInstance(ty)
obj.SendMsg()

However, I have face another problem : debug in runtime, I find that it can
allow me trace the program during runtime, e.g. I add breakpoint in the
child object. It will not show it. Therefore, how can I fix it. Actually , I
cannot change the dynamic design into static design(i.e. add reference to
project in design time).

Thanks for your help
..Net student


Nov 21 '05 #2
Tom
Ok I tried to give you an example :

The host project create a vbform , in the vbform have create the button and
name as "Button1" ,
the button event is follow :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim asm As [Assembly] =
[Assembly].LoadFrom("D:\vb7Project\dynamicCall\prj01\prj01\b in\prj01.dll")
Dim ty As Type = asm.GetType("prj01.dbLib")
Dim obj As Object = Activator.CreateInstance(ty)
obj.SendMsg()

End Sub

Then I create the child project and attach it in the .net solution which
type is class libary name as "prj01" , in this project, I create the class
name "dbLib"
The code like this
Public Class dbLib
Public Function SendMsg()
MsgBox("a")
End Function
End Class
I have set the break point in the statment "MsgBox("a") " , but it is not
active in runtime.
Of course, I must know that add reference method can trace it. But this is a
dynamic design (like "createobject" method)
Can you tell me how can trace the code in the project "prj01".

Thanks

"Anand[MVP]" <An******@discussions.microsoft.com> ¦b¶l¥ó
news:5E**********************************@microsof t.com ¤¤¼¶¼g...
What do you mean by not allowing breakpoint in child object. Do you mean in the SendMessage line of inside the object that you are creating. If you want to debug the object you are creating, you just need to step into the code and it should be able to debug. Otherwise, open that project(the dynamic code
one) and attach to the caller process and debug.

Rgds,
Anand
http://www.dotnetindia.com

"Tom" wrote:
Hi .Net Professional :

In recent , I starting to learn about dynamic call .net object in vb.net.
Before, some IT people teach me use the following method and its work !!

Dim asm As [Assembly] =
[Assembly].LoadFrom("D:\vb7Project\dynamicCall\prj01\prj01\b in\prj01.dll")
Dim ty As Type = asm.GetType("prj01.dbLib")
Dim obj As Object = Activator.CreateInstance(ty)
obj.SendMsg()

However, I have face another problem : debug in runtime, I find that it can allow me trace the program during runtime, e.g. I add breakpoint in the
child object. It will not show it. Therefore, how can I fix it. Actually , I cannot change the dynamic design into static design(i.e. add reference to project in design time).

Thanks for your help
..Net student


Nov 21 '05 #3
You basically set the proj1 project properties and set host project to run
when debugging (Project properties/debugging). Then when you run proj1, the
host project starts and your break point gets hit.

Otherwise, attach the running host project in your proj1 project and when
the host creates the object, your breakpoint is hit.

Rgds,
Anand
http://www.dotnetindia.com

"Tom" wrote:
Ok I tried to give you an example :

The host project create a vbform , in the vbform have create the button and
name as "Button1" ,
the button event is follow :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim asm As [Assembly] =
[Assembly].LoadFrom("D:\vb7Project\dynamicCall\prj01\prj01\b in\prj01.dll")
Dim ty As Type = asm.GetType("prj01.dbLib")
Dim obj As Object = Activator.CreateInstance(ty)
obj.SendMsg()

End Sub

Then I create the child project and attach it in the .net solution which
type is class libary name as "prj01" , in this project, I create the class
name "dbLib"
The code like this
Public Class dbLib
Public Function SendMsg()
MsgBox("a")
End Function
End Class
I have set the break point in the statment "MsgBox("a") " , but it is not
active in runtime.
Of course, I must know that add reference method can trace it. But this is a
dynamic design (like "createobject" method)
Can you tell me how can trace the code in the project "prj01".

Thanks

"Anand[MVP]" <An******@discussions.microsoft.com> ¦b¶l¥ó
news:5E**********************************@microsof t.com ¤¤¼¶¼g...
What do you mean by not allowing breakpoint in child object. Do you mean

in
the SendMessage line of inside the object that you are creating. If you

want
to debug the object you are creating, you just need to step into the code

and
it should be able to debug. Otherwise, open that project(the dynamic code
one) and attach to the caller process and debug.

Rgds,
Anand
http://www.dotnetindia.com

"Tom" wrote:
Hi .Net Professional :

In recent , I starting to learn about dynamic call .net object in vb.net.
Before, some IT people teach me use the following method and its work !!

Dim asm As [Assembly] =
[Assembly].LoadFrom("D:\vb7Project\dynamicCall\prj01\prj01\b in\prj01.dll")
Dim ty As Type = asm.GetType("prj01.dbLib")
Dim obj As Object = Activator.CreateInstance(ty)
obj.SendMsg()

However, I have face another problem : debug in runtime, I find that it can allow me trace the program during runtime, e.g. I add breakpoint in the
child object. It will not show it. Therefore, how can I fix it. Actually , I cannot change the dynamic design into static design(i.e. add reference to project in design time).

Thanks for your help
..Net student



Nov 21 '05 #4
Not sure this is much help, but I do exactly the same as you and debugging
works fine.

The only problem I have in debugging which may or may not be related to this
is when I'm running multiple threads, when single stepping seems to get a
bit problematic if two threads are running the code that I'm single stepping
through at the same time.

Regards
Simon
"Tom" <pc***@tomgroup.com> wrote in message
news:eQ**************@TK2MSFTNGP10.phx.gbl...
Hi .Net Professional :

In recent , I starting to learn about dynamic call .net object in vb.net.

Before, some IT people teach me use the following method and its work !!

Dim asm As [Assembly] =
[Assembly].LoadFrom("D:\vb7Project\dynamicCall\prj01\prj01\b in\prj01.dll")

Dim ty As Type = asm.GetType("prj01.dbLib")
Dim obj As Object = Activator.CreateInstance(ty)
obj.SendMsg()

However, I have face another problem : debug in runtime, I find that it
can
allow me trace the program during runtime, e.g. I add breakpoint in the
child object. It will not show it. Therefore, how can I fix it. Actually ,
I
cannot change the dynamic design into static design(i.e. add reference to
project in design time).

Thanks for your help
.Net student


Nov 21 '05 #5

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

Similar topics

6
by: Mark | last post by:
I have been working for quite some time on this issue which in theory should be quite simple. The problem is that the Cancel and Save events are not fired when their respective buttons are...
10
by: moondaddy | last post by:
I'm writing an ecommerce app in asp.net/vb.net and need to make the pages searchable and crawlable by spiders, particularly Google's. As far as I know, if my pages's contents are mostly populated...
60
by: Peter Olcott | last post by:
I need to know how to get the solution mentioned below to work. The solution is from gbayles Jan 29 2001, 12:50 pm, link is provided below: >...
1
by: Chris Curvey | last post by:
I'm trying to track down a performance issue in my Windows code, and hotshot is telling me that the most time and calls are spent in these methods ncalls tottime percall cumtime percall...
10
by: jflash | last post by:
Hello all, I feel dumb having to ask this question in the first place, but I just can not figure it out. I am wanting to set my site up using dynamic urls (I'm assuming that's what they're...
0
by: alexandre.bergel | last post by:
Dear colleges, You might want to consider Dyla'07 as a good venue to present your work and your favourite programming language. Regards, Alexandre ...
0
by: Alexandre Bergel | last post by:
Dear colleague, Please, note that after the workshop, best papers will be selected, and a second deadline will then be set regarding preparation of the Electronic Communications of the...
2
by: alexis.meilland | last post by:
Hello, Well, I have a problem with a dynamic debuging. My program is winform program written in Managed c++. I compile dynamically a dll in vb.net. It works well. To execute a function in...
26
by: Aaron \Castironpi\ Brady | last post by:
Hello all, To me, this is a somewhat unintuitive behavior. I want to discuss the parts of it I don't understand. .... f= lambda: n .... 9 9
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.