stepping through code that is late bound.

H

hazz

how do I do this? I am certain my Visual Studio .NET solution allowed me to
do this before but I don't know how the build/debug settings were
configured.

In order to get around an unavoidable circular reference constraint,
Activator.CreateInstance was employed in the project.

But now when I run through in debug mode, breakpoints are ignored in the
late bound object. If I were the late bound object I would probably tell the
runtime to stick with its early-bound components and not to bother me. But I
may not be able to do so if some reflection mechanisms are keeping me on a
short leash.

thx, -greg
 
D

Daniel Bass

i know it's the obvious one, but make sure your dll's are all debug mode
with the latest source you have.
 
S

SP

hazz said:
how do I do this? I am certain my Visual Studio .NET solution allowed me to
do this before but I don't know how the build/debug settings were
configured.

In order to get around an unavoidable circular reference constraint,
Activator.CreateInstance was employed in the project.

But now when I run through in debug mode, breakpoints are ignored in the
late bound object. If I were the late bound object I would probably tell the
runtime to stick with its early-bound components and not to bother me. But I
may not be able to do so if some reflection mechanisms are keeping me on a
short leash.

I had the same scenario happen to me after removing the reference from my
GUI project while testing. If there is not a reference to the code that
Activator.CreateInstance is calling then you will not be able to debug.

SP
 
H

hazz

I think you are right Daniel. It works now. I think my project needed to be
cleaned up a bit and definitely be in debug mode. I still marvel at the
ability of the VS.NET environment to keep track of this late bound code. I
have read credible sources warning against the use of late bound components
due to the inability to debug. I can't remember the source. thanks again.
Greg
 
H

hazz

Thanks for the idea SP.

I am not certain this is necessary SP. I am able to debug now in the late
bound component and I do not have a reference set to the component whose
instance I am activating at runtime.

I do have an interface howerver within this assembly that serves as a
template into that other assembly's functionality.

-greg
 
D

Daniel Bass

Greg,

Late bound allows an application to have a plug-in architecture, which I
used in a project recently. It's great because I didn't have to touch the
core application, but was able to extend functionality. All the core needed
was configuration in the registry pointing to the new plug-in interface and
it all hooked in really well.

The reason I say all this is that I debugged the plugin's that were all late
bound with no problems. So I'm afraid to say your "credible source" is
incorrect in this case.

Thanks

Daniel.
 
H

Hazzard

Daniel,

Thanks for sharing that idea about the plug-in architecure. That makes a lot
of sense.
I guess the core could use a config file as well as registry to point to-
the registry being less likely to be tampered with accidentally.
I sometimes hear analogies that correlate software components to electronic
ones. Creating that late-bound connection is like adding a new active device
to help out in the system as opposed to trying to go in and mess with the
existing component.

-Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top