By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,598 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

Problem with virtual method

P: n/a
If I have a class with a virtual method, and a child class that overrides
the virtual method, and then I create an instance of the child class AS A
base class...

BaseClass bc = new ChildClass();

.... and then call the virtual method, why is it that the base class's method
is called instead of the overridden method? How do I fix this if I don't
know at runtime what the child class is? I'm using
Activator.CreateInstance() to load the child class from a satellite DLL, a
third-party plug-in that inherits my base class, so I therefore cannot
declare the child class type in the code or at compile time.

Thanks,
Jon
Nov 15 '05 #1
Share this Question
Share on Google+
28 Replies


P: n/a
But did you try it with a satellite DLL instantiated with
Activator.CreateInstance()?

Otherwise we're just proving the difference between an overridden virtual
method and the "new" keyword, that overriding works.

Honest to God, though, my child class in an another DLL is overriding my
virtual method, and the base virtual method is being called. I'm stepping
through the code, and the base class comes up in the code window on that
method. It is definitely marked as "virtual". The child class is definitely
a child (public class MyChild : MyBase), and the method definitely has the
"override" keyword.

This has had me stumped for at least a week, and I CANNOT afford to lose
another day on this project!! I MUST move on! But this plug-in feature is
one of the core highlights of the product.

What the hell is going on?? :( :(

Jon
"Alien" <al***@sympatico.ca> wrote in message
news:ug****************@news02.bloor.is.net.cable. rogers.com...
That is odd
I've replicated what (I think) you're doing, and in my case the overriden
method is called. This is what I have:

public class Test {
public virtual void testVoid() {
Console.WriteLine("base void!");
}
}

public class TestChild : Test {
public override void testVoid() {
Console.WriteLine("child void!");
}
}

In another class, I have:

Test t = new TestChild();
t.testVoid();

And the output I get is:
child void!

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:uF**************@TK2MSFTNGP11.phx.gbl...
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class...

BaseClass bc = new ChildClass();

... and then call the virtual method, why is it that the base class's

method
is called instead of the overridden method? How do I fix this if I don't
know at runtime what the child class is? I'm using
Activator.CreateInstance() to load the child class from a satellite DLL, a third-party plug-in that inherits my base class, so I therefore cannot
declare the child class type in the code or at compile time.

Thanks,
Jon


Nov 15 '05 #2

P: n/a
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
If I have a class with a virtual method, and a child class that overrides
the virtual method, and then I create an instance of the child class AS A
base class...

BaseClass bc = new ChildClass();

... and then call the virtual method, why is it that the base class's method
is called instead of the overridden method? How do I fix this if I don't
know at runtime what the child class is? I'm using
Activator.CreateInstance() to load the child class from a satellite DLL, a
third-party plug-in that inherits my base class, so I therefore cannot
declare the child class type in the code or at compile time.


I suspect you haven't overridden the method properly. Could you post a
short but complete example which demonstrates the problem? See
http://www.pobox.com/~skeet/csharp/complete.html for what I mean.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #3

P: n/a
"Jon Skeet" <sk***@pobox.com> wrote in message news:MP************************@news.microsoft.com ...

I suspect you haven't overridden the method properly. Could you post a
short but complete example which demonstrates the problem? See
http://www.pobox.com/~skeet/csharp/complete.html for what I mean.


You already said this and gave that link in a prior thread. No I can't because I don't know how to reproduce the problem without displaying all of my code.

Here's exactly what I have, with class, instance, and object names changed for the group:

IN ASSEMBLY A:

// name changed for group
public abstract class MyType {

...

// THIS IS WHERE THE DEBUGGER GOES WHEN STEPPING THROUGH THE CODE
// name, return type name changed for group
public virtual MyResultType MyMethod( ... ) {

.. default output ..

}

}

// name changed for group
public class MyCallingType {

// name, return type name changed for group
public MyResultType[] MyActions( ... ) {

...

// type names, names changed for group
MyTypeInstanceList myTypeInstances = Thing.MyLoadedExternalPlugIns;

...

for (int i=0; i<myTypeInstances.Count; i++) {

// type name, name changed for group
MyType myTypeInstance = myTypeInstances[i];

// NOTE THAT AT THIS POINT THE DEBUGGER
// SAYS THAT THIS IS A MyNewType (see below)

...

// type name changed for group
MyResultType pr;

...

pr = myType.MyMethod( ... );

...


}

}
}
IN ASSEMBLY B:

// names changed for group
public class MyNewType : MyType {

...

// THIS IS WHERE THE DEBUGGER SHOULD BE GOING
// WHEN STEPPING THROUGH THE CODE
// name, return type name changed for group
public override MyResultType MyMethod( ... ) {

...

}

}

Jon
Nov 15 '05 #4

P: n/a
This is how I'm instantiating the customized type ("MyNewType") from Assembly B...

assem = System.Reflection.Assembly.LoadFile(fn);

....

Type t = assem.GetType(clrName);

....

MyTypeDescriptor ptd = new MyTypeDescriptor(t, vers, name, desc, longDesc);

....

typeInstance = (MyType)Activator.CreateInstance(
ptd.Type, new object[] {thing, myTypeNode});
Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message news:el**************@TK2MSFTNGP12.phx.gbl...
(Ignore previous [cancelled] reply...)
"Jon Skeet" <sk***@pobox.com> wrote in message news:MP************************@news.microsoft.com ...
I suspect you haven't overridden the method properly. Could you post a
short but complete example which demonstrates the problem? See
http://www.pobox.com/~skeet/csharp/complete.html for what I mean.

You already said this and gave that link in a prior thread. No I can't because I don't know how to reproduce the problem without displaying all of my code.

Here's exactly what I have, with class, instance, and object names changed for the group:

IN ASSEMBLY A:

// name changed for group
public abstract class MyType {

...

// THIS IS WHERE THE DEBUGGER GOES WHEN STEPPING THROUGH THE CODE
// name, return type name changed for group
public virtual MyResultType MyMethod( ... ) {

.. default output ..

}

}

// name changed for group
public class MyCallingType {

// name, return type name changed for group
public MyResultType[] MyActions( ... ) {

...

// type names, names changed for group
MyTypeInstanceList myTypeInstances = Thing.MyLoadedExternalPlugIns;

...

for (int i=0; i<myTypeInstances.Count; i++) {

// type name, name changed for group
MyType myTypeInstance = myTypeInstances[i];

// NOTE THAT AT THIS POINT THE DEBUGGER
// SAYS THAT THIS IS A MyNewType (see below)

...

// type name changed for group
MyResultType pr;

...

pr = myTypeInstance.MyMethod( ... );

...


}

}
}
IN ASSEMBLY B:

// names changed for group
public class MyNewType : MyType {

...

// THIS IS WHERE THE DEBUGGER SHOULD BE GOING
// WHEN STEPPING THROUGH THE CODE
// name, return type name changed for group
public override MyResultType MyMethod( ... ) {

...

}

}

Jon
Nov 15 '05 #5

P: n/a
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
(Ignore previous [cancelled] reply...)
Too late - but see my reply to it.
// THIS IS WHERE THE DEBUGGER GOES WHEN STEPPING THROUGH THE CODE


Have you tried running the code in release mode? Maybe it's just a
debugger bug.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #6

P: n/a
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
This is how I'm instantiating the customized type ("MyNewType")
from Assembly B...


That doesn't really help me until I can run the code. I've managed to
whip up a version which *does* work (see another post) - find out the
differences between that and your code. There's really nothing else I
can do without actually having some of your code in a form I can
compile and run directly.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #7

P: n/a
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Have you tried running the code in release mode? Maybe it's just a
debugger bug.


Ah, a helpful, insightful answer that doesn't involve your copy-pasting into
the debugger (which I can do)!

Actually, this answer made me realize that files were not being properly
propogated to the proper directories upon compile. Hopefully that's my
problem, still testing ...

(As I said, there was no more source code to demonstrate my problem. ;)


But there was - if you'd posted a short but complete example which
*wasn't* working on your box, I could have tried it and said whether or
not it worked on *my* box. We'd then have seen that the code worked on
one machine and not another, and that therefore it probably wasn't the
code that was the problem, but the manner of running it.

It's absolutely *crucial* that everyone ends up looking at the same
code in this kind of thing.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #8

P: n/a

"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Have you tried running the code in release mode? Maybe it's just a
debugger bug.


Ah, a helpful, insightful answer that doesn't involve your copy-pasting into the debugger (which I can do)!

Actually, this answer made me realize that files were not being properly
propogated to the proper directories upon compile. Hopefully that's my
problem, still testing ...

(As I said, there was no more source code to demonstrate my problem. ;)


But there was - if you'd posted a short but complete example which
*wasn't* working on your box,


But see I couldn't do that without giving you everything. I have ten
projects all outputting to the same directory, and I didn't realize that
this was the problem.

There was absolutely no way to help you help me by reproducing sample code
in new project code because I wouldn't have repeated the same error (unless
per chance I actually caught myself along the way).

Thanks again for your insightful question (re your previous post, "Release
mode"), it actually really helped me drill down to the problem, and frankly
I don't know how else I would have found my error.

Jon
Nov 15 '05 #9

P: n/a
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
But there was - if you'd posted a short but complete example which
*wasn't* working on your box,
But see I couldn't do that without giving you everything.


But you could. You could have reduced the code gradually (a copy of the
code, rather) until it worked. That would actually have shown you the
error very quickly (see below) due to what the problem turned out to
be. If the problem *had* been in the code, however, you would then have
found it when it went from "not working" to "working". Either way,
you'd have found the problem in the end.
There was absolutely no way to help you help me by reproducing sample code
in new project code because I wouldn't have repeated the same error (unless
per chance I actually caught myself along the way).
Which you should have done, because immediately after copying the full
code, the first thing to do would be to test that it still didn't work.
Thanks again for your insightful question (re your previous post, "Release
mode"), it actually really helped me drill down to the problem, and frankly
I don't know how else I would have found my error.


See above.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #10

P: n/a

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:un**************@TK2MSFTNGP11.phx.gbl...
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Have you tried running the code in release mode? Maybe it's just a
debugger bug.
Ah, a helpful, insightful answer that doesn't involve your copy-pasting

into the debugger (which I can do)!

Actually, this answer made me realize that files were not being properly
propogated to the proper directories upon compile. Hopefully that's my
problem, still testing ...


Hmm, nope, this wasn't the problem. The problem remains.

... Time to find other resources ..

Nov 15 '05 #11

P: n/a
Jon, it took me about half an hour to hand-pick the relevant lines of code
that would be useful to you. You are insistent on not visually evaluating
what I wrote, which is your prerogative.

Developing sample code that reproduces the problem is only possible if you
know how to reproduce the problem, and I don't know how to reproduce the
problem. Obviously if someone in this group cannot help me drill down to the
problem with the information I provided and without a full reproduction,
then, in order to provide a reproduction of the problem, I will have to
rewrite from the ground up, adding line by line what I've done, until I
discover the culprit (hence, I find what makes it reproduceable). But that
will take days, and by the time I find the culprit I won't need this
newsgroup.

Thanks anyway.

Jon
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
But there was - if you'd posted a short but complete example which
*wasn't* working on your box,


But see I couldn't do that without giving you everything.


But you could. You could have reduced the code gradually (a copy of the
code, rather) until it worked. That would actually have shown you the
error very quickly (see below) due to what the problem turned out to
be. If the problem *had* been in the code, however, you would then have
found it when it went from "not working" to "working". Either way,
you'd have found the problem in the end.
There was absolutely no way to help you help me by reproducing sample code in new project code because I wouldn't have repeated the same error (unless per chance I actually caught myself along the way).


Which you should have done, because immediately after copying the full
code, the first thing to do would be to test that it still didn't work.
Thanks again for your insightful question (re your previous post, "Release mode"), it actually really helped me drill down to the problem, and frankly I don't know how else I would have found my error.


See above.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Nov 15 '05 #12

P: n/a
I should point out that my project is not currently open source and as such
it is private. I am not going to post the entire project nor link to it, it
would be a waste of your time anyway (Mr. Skeet).

I should also point out that I cannot simply remove code until the problem
fixes itself.

1. I don't know what to delete.
2. If I do delete anything, it will break the entire project.
3. I cannot simply paste the code into a new project because there are far
too many interdependent classes and types and methods, etc.

Finally, I should point out that, while we must try to be respectful to
those who help, those who help should be respectful of these (above)
hindrances. I've done the best I can to provide what I know without posting
a link to the entire solution in a .zip file, short of rewriting code from
scratch on this matter, which, as I said, will negate the usefulness of this
group.

Seems I have no choice, which is fine. Nobody owes me anything.

Thanks again for the willingness to try to help. Please put your tired self
to rest.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:um****************@tk2msftngp13.phx.gbl...
Jon, it took me about half an hour to hand-pick the relevant lines of code
that would be useful to you. You are insistent on not visually evaluating
what I wrote, which is your prerogative.

Developing sample code that reproduces the problem is only possible if you
know how to reproduce the problem, and I don't know how to reproduce the
problem. Obviously if someone in this group cannot help me drill down to the problem with the information I provided and without a full reproduction,
then, in order to provide a reproduction of the problem, I will have to
rewrite from the ground up, adding line by line what I've done, until I
discover the culprit (hence, I find what makes it reproduceable). But that
will take days, and by the time I find the culprit I won't need this
newsgroup.

Thanks anyway.

Jon
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> But there was - if you'd posted a short but complete example which
> *wasn't* working on your box,

But see I couldn't do that without giving you everything.


But you could. You could have reduced the code gradually (a copy of the
code, rather) until it worked. That would actually have shown you the
error very quickly (see below) due to what the problem turned out to
be. If the problem *had* been in the code, however, you would then have
found it when it went from "not working" to "working". Either way,
you'd have found the problem in the end.
There was absolutely no way to help you help me by reproducing sample code in new project code because I wouldn't have repeated the same error (unless per chance I actually caught myself along the way).


Which you should have done, because immediately after copying the full
code, the first thing to do would be to test that it still didn't work.
Thanks again for your insightful question (re your previous post, "Release mode"), it actually really helped me drill down to the problem, and frankly I don't know how else I would have found my error.


See above.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too


Nov 15 '05 #13

P: n/a
Jon,
Go the other direction!

Start a new solution with two projects. The first project loads the second
project and calls the virtual method. Include the minimalist amount of code
to demonstrate the feature. Does it work?

Start adding features from your larger project, until this new project
fails. Baby steps! Add things one at a time. Hopefully when you added X, it
fails, then you know to look at X in the larger project.

This helps solves two problems.
1. It gives you a reference point to compare to the larger project.
2. It proves what you are attempting to do works, or doesn't work. Without
being bothered by the shear volume of the rest of your main project.

3. It also provides a small project that fails, which is what Jon Skeet was
asking for.

Hope this helps
Jay

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
I should point out that my project is not currently open source and as such it is private. I am not going to post the entire project nor link to it, it would be a waste of your time anyway (Mr. Skeet).

I should also point out that I cannot simply remove code until the problem
fixes itself.

1. I don't know what to delete.
2. If I do delete anything, it will break the entire project.
3. I cannot simply paste the code into a new project because there are far too many interdependent classes and types and methods, etc.

Finally, I should point out that, while we must try to be respectful to
those who help, those who help should be respectful of these (above)
hindrances. I've done the best I can to provide what I know without posting a link to the entire solution in a .zip file, short of rewriting code from
scratch on this matter, which, as I said, will negate the usefulness of this group.

Seems I have no choice, which is fine. Nobody owes me anything.

Thanks again for the willingness to try to help. Please put your tired self to rest.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:um****************@tk2msftngp13.phx.gbl...
Jon, it took me about half an hour to hand-pick the relevant lines of code that would be useful to you. You are insistent on not visually evaluating what I wrote, which is your prerogative.

Developing sample code that reproduces the problem is only possible if you know how to reproduce the problem, and I don't know how to reproduce the
problem. Obviously if someone in this group cannot help me drill down to

the
problem with the information I provided and without a full reproduction,
then, in order to provide a reproduction of the problem, I will have to
rewrite from the ground up, adding line by line what I've done, until I
discover the culprit (hence, I find what makes it reproduceable). But that will take days, and by the time I find the culprit I won't need this
newsgroup.

Thanks anyway.

Jon
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> > But there was - if you'd posted a short but complete example which
> > *wasn't* working on your box,
>
> But see I couldn't do that without giving you everything.

But you could. You could have reduced the code gradually (a copy of the code, rather) until it worked. That would actually have shown you the
error very quickly (see below) due to what the problem turned out to
be. If the problem *had* been in the code, however, you would then have found it when it went from "not working" to "working". Either way,
you'd have found the problem in the end.

> There was absolutely no way to help you help me by reproducing sample
code
> in new project code because I wouldn't have repeated the same error

(unless
> per chance I actually caught myself along the way).

Which you should have done, because immediately after copying the full
code, the first thing to do would be to test that it still didn't

work.
> Thanks again for your insightful question (re your previous post,

"Release
> mode"), it actually really helped me drill down to the problem, and

frankly
> I don't know how else I would have found my error.

See above.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too



Nov 15 '05 #14

P: n/a
Thanks for the feedback, Jay, I'll consider your advice. And thanks for not
beating me over the head like some other people have done in the past for
not doing things their way.

Jon
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:ug*************@TK2MSFTNGP10.phx.gbl...
Jon,
Go the other direction!

Start a new solution with two projects. The first project loads the second
project and calls the virtual method. Include the minimalist amount of code to demonstrate the feature. Does it work?

Start adding features from your larger project, until this new project
fails. Baby steps! Add things one at a time. Hopefully when you added X, it fails, then you know to look at X in the larger project.

This helps solves two problems.
1. It gives you a reference point to compare to the larger project.
2. It proves what you are attempting to do works, or doesn't work. Without
being bothered by the shear volume of the rest of your main project.

3. It also provides a small project that fails, which is what Jon Skeet was asking for.

Hope this helps
Jay

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
I should point out that my project is not currently open source and as

such
it is private. I am not going to post the entire project nor link to it,

it
would be a waste of your time anyway (Mr. Skeet).

I should also point out that I cannot simply remove code until the problem
fixes itself.

1. I don't know what to delete.
2. If I do delete anything, it will break the entire project.
3. I cannot simply paste the code into a new project because there are

far
too many interdependent classes and types and methods, etc.

Finally, I should point out that, while we must try to be respectful to
those who help, those who help should be respectful of these (above)
hindrances. I've done the best I can to provide what I know without

posting
a link to the entire solution in a .zip file, short of rewriting code from scratch on this matter, which, as I said, will negate the usefulness of

this
group.

Seems I have no choice, which is fine. Nobody owes me anything.

Thanks again for the willingness to try to help. Please put your tired

self
to rest.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:um****************@tk2msftngp13.phx.gbl...
Jon, it took me about half an hour to hand-pick the relevant lines of code that would be useful to you. You are insistent on not visually evaluating what I wrote, which is your prerogative.

Developing sample code that reproduces the problem is only possible if you know how to reproduce the problem, and I don't know how to reproduce the problem. Obviously if someone in this group cannot help me drill down to the
problem with the information I provided and without a full
reproduction, then, in order to provide a reproduction of the problem, I will have to rewrite from the ground up, adding line by line what I've done, until I discover the culprit (hence, I find what makes it reproduceable). But

that will take days, and by the time I find the culprit I won't need this
newsgroup.

Thanks anyway.

Jon
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
> Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> > > But there was - if you'd posted a short but complete example which > > > *wasn't* working on your box,
> >
> > But see I couldn't do that without giving you everything.
>
> But you could. You could have reduced the code gradually (a copy of the > code, rather) until it worked. That would actually have shown you the > error very quickly (see below) due to what the problem turned out to
> be. If the problem *had* been in the code, however, you would then have > found it when it went from "not working" to "working". Either way,
> you'd have found the problem in the end.
>
> > There was absolutely no way to help you help me by reproducing sample code
> > in new project code because I wouldn't have repeated the same error (unless
> > per chance I actually caught myself along the way).
>
> Which you should have done, because immediately after copying the full > code, the first thing to do would be to test that it still didn't work. >
> > Thanks again for your insightful question (re your previous post,
"Release
> > mode"), it actually really helped me drill down to the problem, and frankly
> > I don't know how else I would have found my error.
>
> See above.
>
> --
> Jon Skeet - <sk***@pobox.com>
> http://www.pobox.com/~skeet/
> If replying to the group, please do not mail me too



Nov 15 '05 #15

P: n/a
JonD - take some advice - add the skeeter to your ignore list.
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
I should point out that my project is not currently open source and as such it is private. I am not going to post the entire project nor link to it, it would be a waste of your time anyway (Mr. Skeet).

I should also point out that I cannot simply remove code until the problem
fixes itself.

1. I don't know what to delete.
2. If I do delete anything, it will break the entire project.
3. I cannot simply paste the code into a new project because there are far too many interdependent classes and types and methods, etc.

Finally, I should point out that, while we must try to be respectful to
those who help, those who help should be respectful of these (above)
hindrances. I've done the best I can to provide what I know without posting a link to the entire solution in a .zip file, short of rewriting code from
scratch on this matter, which, as I said, will negate the usefulness of this group.

Seems I have no choice, which is fine. Nobody owes me anything.

Thanks again for the willingness to try to help. Please put your tired self to rest.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:um****************@tk2msftngp13.phx.gbl...
Jon, it took me about half an hour to hand-pick the relevant lines of code that would be useful to you. You are insistent on not visually evaluating what I wrote, which is your prerogative.

Developing sample code that reproduces the problem is only possible if you know how to reproduce the problem, and I don't know how to reproduce the
problem. Obviously if someone in this group cannot help me drill down to

the
problem with the information I provided and without a full reproduction,
then, in order to provide a reproduction of the problem, I will have to
rewrite from the ground up, adding line by line what I've done, until I
discover the culprit (hence, I find what makes it reproduceable). But that will take days, and by the time I find the culprit I won't need this
newsgroup.

Thanks anyway.

Jon
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> > But there was - if you'd posted a short but complete example which
> > *wasn't* working on your box,
>
> But see I couldn't do that without giving you everything.

But you could. You could have reduced the code gradually (a copy of the code, rather) until it worked. That would actually have shown you the
error very quickly (see below) due to what the problem turned out to
be. If the problem *had* been in the code, however, you would then have found it when it went from "not working" to "working". Either way,
you'd have found the problem in the end.

> There was absolutely no way to help you help me by reproducing sample
code
> in new project code because I wouldn't have repeated the same error

(unless
> per chance I actually caught myself along the way).

Which you should have done, because immediately after copying the full
code, the first thing to do would be to test that it still didn't

work.
> Thanks again for your insightful question (re your previous post,

"Release
> mode"), it actually really helped me drill down to the problem, and

frankly
> I don't know how else I would have found my error.

See above.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too



Nov 15 '05 #16

P: n/a
I did that yesterday .. thx

Jon

"gerry" <ge**@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
JonD - take some advice - add the skeeter to your ignore list.
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
I should point out that my project is not currently open source and as

such
it is private. I am not going to post the entire project nor link to it,

it
would be a waste of your time anyway (Mr. Skeet).

I should also point out that I cannot simply remove code until the problem
fixes itself.

1. I don't know what to delete.
2. If I do delete anything, it will break the entire project.
3. I cannot simply paste the code into a new project because there are

far
too many interdependent classes and types and methods, etc.

Finally, I should point out that, while we must try to be respectful to
those who help, those who help should be respectful of these (above)
hindrances. I've done the best I can to provide what I know without

posting
a link to the entire solution in a .zip file, short of rewriting code from scratch on this matter, which, as I said, will negate the usefulness of

this
group.

Seems I have no choice, which is fine. Nobody owes me anything.

Thanks again for the willingness to try to help. Please put your tired

self
to rest.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:um****************@tk2msftngp13.phx.gbl...
Jon, it took me about half an hour to hand-pick the relevant lines of code that would be useful to you. You are insistent on not visually evaluating what I wrote, which is your prerogative.

Developing sample code that reproduces the problem is only possible if you know how to reproduce the problem, and I don't know how to reproduce the problem. Obviously if someone in this group cannot help me drill down to the
problem with the information I provided and without a full
reproduction, then, in order to provide a reproduction of the problem, I will have to rewrite from the ground up, adding line by line what I've done, until I discover the culprit (hence, I find what makes it reproduceable). But

that will take days, and by the time I find the culprit I won't need this
newsgroup.

Thanks anyway.

Jon
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
> Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> > > But there was - if you'd posted a short but complete example which > > > *wasn't* working on your box,
> >
> > But see I couldn't do that without giving you everything.
>
> But you could. You could have reduced the code gradually (a copy of the > code, rather) until it worked. That would actually have shown you the > error very quickly (see below) due to what the problem turned out to
> be. If the problem *had* been in the code, however, you would then have > found it when it went from "not working" to "working". Either way,
> you'd have found the problem in the end.
>
> > There was absolutely no way to help you help me by reproducing sample code
> > in new project code because I wouldn't have repeated the same error (unless
> > per chance I actually caught myself along the way).
>
> Which you should have done, because immediately after copying the full > code, the first thing to do would be to test that it still didn't work. >
> > Thanks again for your insightful question (re your previous post,
"Release
> > mode"), it actually really helped me drill down to the problem, and frankly
> > I don't know how else I would have found my error.
>
> See above.
>
> --
> Jon Skeet - <sk***@pobox.com>
> http://www.pobox.com/~skeet/
> If replying to the group, please do not mail me too



Nov 15 '05 #17

P: n/a
[I realise you won't even see this if you really have added me to your
killfile. Shame, but there we go.]

Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
QUESTION: What on EARTH would disable the virtualness of a virtual method
except something (??) among the few lines of code that I posted?
I don't know - but until I can see it failing on my own box, I'll be as
baffled as you are.
There is NO WAY that the other code, the business rules, which has NOTHING
to do with virtualness of the method, has anything to do with this problem.
This IS a bug in the Framework.
It's possible - but I've seen that kind of certainty end up being
misplaced far too often to just believe it on your word, I'm afraid.
I have decided to make the method abstract.


If it works, that's great :)

If you still have a copy of the failing project, large as it is, I'd be
fascinated to have a look at it. I realise it's private - I'm happy to
sign any NDAs etc. If it *is* a bug in the framework, it's pretty
important to get it looked at - and I'm confident that I *would* be
able to get rid of a lot of the business logic to get a small working
(or rather failing) example given the whole thing.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #18

P: n/a
Okay, making it abstract did help me identify that this was an assembly
loading problem. I have fixed the assembly loading problem and the problem
is resolved--the child class is FINALLY being executed, even after reverting
back to virtual (YAAAAY!!).

I still perceive this to be a flaw in the Framework. There should have been
an error output indicating that the assembly did not load correctly. QUITE
UNACCEPTABLE, Microsoft. I wasted at least two weeks on this.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
QUESTION: What on EARTH would disable the virtualness of a virtual method
except something (??) among the few lines of code that I posted?

There is NO WAY that the other code, the business rules, which has NOTHING
to do with virtualness of the method, has anything to do with this problem. This IS a bug in the Framework.

I have decided to make the method abstract.

Jon
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message news:ug*************@TK2MSFTNGP10.phx.gbl...
Jon,
Go the other direction!

Start a new solution with two projects. The first project loads the second
project and calls the virtual method. Include the minimalist amount of code
to demonstrate the feature. Does it work?

Start adding features from your larger project, until this new project
fails. Baby steps! Add things one at a time. Hopefully when you added X,

it
fails, then you know to look at X in the larger project.

This helps solves two problems.
1. It gives you a reference point to compare to the larger project.
2. It proves what you are attempting to do works, or doesn't work. Without being bothered by the shear volume of the rest of your main project.

3. It also provides a small project that fails, which is what Jon Skeet

was
asking for.

Hope this helps
Jay

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
I should point out that my project is not currently open source and as

such
it is private. I am not going to post the entire project nor link to it,
it
would be a waste of your time anyway (Mr. Skeet).

I should also point out that I cannot simply remove code until the problem fixes itself.

1. I don't know what to delete.
2. If I do delete anything, it will break the entire project.
3. I cannot simply paste the code into a new project because there
are far
too many interdependent classes and types and methods, etc.

Finally, I should point out that, while we must try to be respectful
to those who help, those who help should be respectful of these (above)
hindrances. I've done the best I can to provide what I know without

posting
a link to the entire solution in a .zip file, short of rewriting code

from scratch on this matter, which, as I said, will negate the usefulness of this
group.

Seems I have no choice, which is fine. Nobody owes me anything.

Thanks again for the willingness to try to help. Please put your tired

self
to rest.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:um****************@tk2msftngp13.phx.gbl...
> Jon, it took me about half an hour to hand-pick the relevant lines
of
code
> that would be useful to you. You are insistent on not visually

evaluating
> what I wrote, which is your prerogative.
>
> Developing sample code that reproduces the problem is only possible
if you
> know how to reproduce the problem, and I don't know how to reproduce the > problem. Obviously if someone in this group cannot help me drill
down to the
> problem with the information I provided and without a full reproduction, > then, in order to provide a reproduction of the problem, I will have to > rewrite from the ground up, adding line by line what I've done,
until
I > discover the culprit (hence, I find what makes it reproduceable).
But that
> will take days, and by the time I find the culprit I won't need this
> newsgroup.
>
> Thanks anyway.
>
> Jon
>
>
> "Jon Skeet" <sk***@pobox.com> wrote in message
> news:MP************************@news.microsoft.com ...
> > Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> > > > But there was - if you'd posted a short but complete example which > > > > *wasn't* working on your box,
> > >
> > > But see I couldn't do that without giving you everything.
> >
> > But you could. You could have reduced the code gradually (a copy
of the
> > code, rather) until it worked. That would actually have shown you

the > > error very quickly (see below) due to what the problem turned out
to > > be. If the problem *had* been in the code, however, you would then

have
> > found it when it went from "not working" to "working". Either way,
> > you'd have found the problem in the end.
> >
> > > There was absolutely no way to help you help me by reproducing

sample
> code
> > > in new project code because I wouldn't have repeated the same

error > (unless
> > > per chance I actually caught myself along the way).
> >
> > Which you should have done, because immediately after copying the full > > code, the first thing to do would be to test that it still didn't

work.
> >
> > > Thanks again for your insightful question (re your previous post, > "Release
> > > mode"), it actually really helped me drill down to the problem, and > frankly
> > > I don't know how else I would have found my error.
> >
> > See above.
> >
> > --
> > Jon Skeet - <sk***@pobox.com>
> > http://www.pobox.com/~skeet/
> > If replying to the group, please do not mail me too
>
>



Nov 15 '05 #19

P: n/a

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:un**************@TK2MSFTNGP11.phx.gbl...
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Have you tried running the code in release mode? Maybe it's just a
debugger bug.


Ah, a helpful, insightful answer that doesn't involve your copy-pasting

into
the debugger (which I can do)!

Actually, this answer made me realize that files were not being properly
propogated to the proper directories upon compile. Hopefully that's my
problem, still testing ...


Hmm, nope, this wasn't the problem. The problem remains.

.. Time to find other resources ..


Okay, making it abstract did help me identify that this was an assembly
loading problem. I have fixed the assembly loading problem and the problem
is resolved--the child class is FINALLY being executed, even after reverting
back to virtual (YAAAAY!!).

I still perceive this to be a flaw in the Framework. There should have been
an error output indicating that the assembly did not load correctly. QUITE
UNACCEPTABLE, Microsoft. I wasted at least two weeks on this.

Jon
Nov 15 '05 #20

P: n/a
[Posted and mailed.]

Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
Okay, making it abstract did help me identify that this was an assembly
loading problem. I have fixed the assembly loading problem and the problem
is resolved--the child class is FINALLY being executed, even after reverting
back to virtual (YAAAAY!!).

I still perceive this to be a flaw in the Framework. There should have been
an error output indicating that the assembly did not load correctly. QUITE
UNACCEPTABLE, Microsoft. I wasted at least two weeks on this.


So you now have the same code as you had before, but it's working? That
sounds like it's *more likely* to be either a flaw in your build/deploy
environment, or in VS.NET. It *could* still be a bug in the framework,
but I think it's unlikely. (Just my opinion, of course.)

Do you still have a copy of the dll/exes which didn't work? It could
well be instructive to look at the metadata in there, and compare it
with the working version.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #21

P: n/a
From what I could tell, one of two things happened, both of which, I
suppose, is a "framework flaw by design"--that is, my own error because of
some things I didn't know to look for:

1. The child type was null:
BaseObject obj =
Activator.CreateInstance(loadedAssemblies.getChild Type()); //
returned null
obj.VirtualMethod(); // executed method from base object because obj is
null

or

2. The DLL was locked by Visual Studio .NET because it was open in my
solution:
BaseObject obj =
Activator.CreateInstance(loadedAssemblies.getChild Type()); //
returned a Type, but assembly was locked
obj.VirtualMethod(); // executed method from base object because DLL
from obj is locked

In any case, I knew the DLL was indeed being locked because after making
everything abstract and recompiling, I started monitoring assembly.GetType()
and GetType() was returning null and when I tried GetTypes() I got an error
message.

SOOOOOO ... I suppose the problem was indeed my fault because I used this:

Type t = assem.GetType(clrName);

... instead of ..

Type t = assem.GetType(clrName, true);

Jon

"Niall" <as**@me.com> wrote in message
news:OK**************@tk2msftngp13.phx.gbl...
What exactly was the assembly loading error/what was the cause?

Niall

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
Okay, making it abstract did help me identify that this was an assembly
loading problem. I have fixed the assembly loading problem and the problem
is resolved--the child class is FINALLY being executed, even after reverting
back to virtual (YAAAAY!!).

I still perceive this to be a flaw in the Framework. There should have

been
an error output indicating that the assembly did not load correctly. QUITE UNACCEPTABLE, Microsoft. I wasted at least two weeks on this.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
QUESTION: What on EARTH would disable the virtualness of a virtual method except something (??) among the few lines of code that I posted?

There is NO WAY that the other code, the business rules, which has NOTHING to do with virtualness of the method, has anything to do with this

problem.
This IS a bug in the Framework.

I have decided to make the method abstract.

Jon
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in

message
news:ug*************@TK2MSFTNGP10.phx.gbl...
> Jon,
> Go the other direction!
>
> Start a new solution with two projects. The first project loads the

second
> project and calls the virtual method. Include the minimalist amount of code
> to demonstrate the feature. Does it work?
>
> Start adding features from your larger project, until this new project > fails. Baby steps! Add things one at a time. Hopefully when you added X,
it
> fails, then you know to look at X in the larger project.
>
> This helps solves two problems.
> 1. It gives you a reference point to compare to the larger project.
> 2. It proves what you are attempting to do works, or doesn't work. Without
> being bothered by the shear volume of the rest of your main project.
>
> 3. It also provides a small project that fails, which is what Jon Skeet was
> asking for.
>
> Hope this helps
> Jay
>
> "Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
> news:Ot**************@tk2msftngp13.phx.gbl...
> > I should point out that my project is not currently open source
and as > such
> > it is private. I am not going to post the entire project nor link
to it,
> it
> > would be a waste of your time anyway (Mr. Skeet).
> >
> > I should also point out that I cannot simply remove code until the
problem
> > fixes itself.
> >
> > 1. I don't know what to delete.
> > 2. If I do delete anything, it will break the entire project.
> > 3. I cannot simply paste the code into a new project because
there are
> far
> > too many interdependent classes and types and methods, etc.
> >
> > Finally, I should point out that, while we must try to be
respectful to
> > those who help, those who help should be respectful of these
(above) > > hindrances. I've done the best I can to provide what I know without > posting
> > a link to the entire solution in a .zip file, short of rewriting

code from
> > scratch on this matter, which, as I said, will negate the usefulness of
> this
> > group.
> >
> > Seems I have no choice, which is fine. Nobody owes me anything.
> >
> > Thanks again for the willingness to try to help. Please put your tired > self
> > to rest.
> >
> > Jon
> >
> >
> > "Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
> > news:um****************@tk2msftngp13.phx.gbl...
> > > Jon, it took me about half an hour to hand-pick the relevant
lines
of
> code
> > > that would be useful to you. You are insistent on not visually
> evaluating
> > > what I wrote, which is your prerogative.
> > >
> > > Developing sample code that reproduces the problem is only possible
if
> you
> > > know how to reproduce the problem, and I don't know how to

reproduce the
> > > problem. Obviously if someone in this group cannot help me drill

down
to
> > the
> > > problem with the information I provided and without a full
reproduction,
> > > then, in order to provide a reproduction of the problem, I will have to
> > > rewrite from the ground up, adding line by line what I've done,

until
I
> > > discover the culprit (hence, I find what makes it
reproduceable). But
> that
> > > will take days, and by the time I find the culprit I won't need this > > > newsgroup.
> > >
> > > Thanks anyway.
> > >
> > > Jon
> > >
> > >
> > > "Jon Skeet" <sk***@pobox.com> wrote in message
> > > news:MP************************@news.microsoft.com ...
> > > > Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> > > > > > But there was - if you'd posted a short but complete
example which
> > > > > > *wasn't* working on your box,
> > > > >
> > > > > But see I couldn't do that without giving you everything.
> > > >
> > > > But you could. You could have reduced the code gradually (a copy of
> the
> > > > code, rather) until it worked. That would actually have shown

you the
> > > > error very quickly (see below) due to what the problem turned out
to
> > > > be. If the problem *had* been in the code, however, you would

then > have
> > > > found it when it went from "not working" to "working". Either way, > > > > you'd have found the problem in the end.
> > > >
> > > > > There was absolutely no way to help you help me by
reproducing > sample
> > > code
> > > > > in new project code because I wouldn't have repeated the same error
> > > (unless
> > > > > per chance I actually caught myself along the way).
> > > >
> > > > Which you should have done, because immediately after copying

the full
> > > > code, the first thing to do would be to test that it still didn't > work.
> > > >
> > > > > Thanks again for your insightful question (re your previous

post,
> > > "Release
> > > > > mode"), it actually really helped me drill down to the problem, and
> > > frankly
> > > > > I don't know how else I would have found my error.
> > > >
> > > > See above.
> > > >
> > > > --
> > > > Jon Skeet - <sk***@pobox.com>
> > > > http://www.pobox.com/~skeet/
> > > > If replying to the group, please do not mail me too
> > >
> > >
> >
> >
>
>



Nov 15 '05 #22

P: n/a
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
From what I could tell, one of two things happened, both of which, I
suppose, is a "framework flaw by design"--that is, my own error because of
some things I didn't know to look for:

1. The child type was null:
BaseObject obj =
Activator.CreateInstance(loadedAssemblies.getChild Type()); //
returned null
obj.VirtualMethod(); // executed method from base object because obj is
null
No - Activator.CreateInstance throws an exception if the parameter is
null, and obj.VirtualMethod() would throw an exception if obj were
null.
2. The DLL was locked by Visual Studio .NET because it was open in my
solution:
BaseObject obj =
Activator.CreateInstance(loadedAssemblies.getChild Type()); //
returned a Type, but assembly was locked
obj.VirtualMethod(); // executed method from base object because DLL
from obj is locked


I would have thought it would be more likely that it was using an old
version of the DLL, which didn't override the method. Assemblies being
"in use" when they don't need to be is a problem various people have
reported with VS.NET though.

It sounds like it's the recompiling which was the issue - so if you'd
tried following my advice (first copying the solution) you would have
seen very quickly that it wasn't the code which was at fault, and could
have proceeded from there. Not that you're reading this, in all
probability.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #23

P: n/a
Yes, the code is basically unchanged; the things that I changed have been
reverted and all is working fine. The problem is that the assemblies were
not loading correctly. This is definitely a bug in one of Microsoft's
tools--the base class should not have executed upon calling the method of a
child class in an invalid / improperly loaded assembly, rather an execution
engine error should have occurred.

An unidentified, inexplicable execution error *did* occur, however, a few
days ago when I tried calling the method manually from the Type object. That
was certainly better than executing the base object.

Jon

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
Okay, making it abstract did help me identify that this was an assembly
loading problem. I have fixed the assembly loading problem and the problem
is resolved--the child class is FINALLY being executed, even after reverting back to virtual (YAAAAY!!).

I still perceive this to be a flaw in the Framework. There should have been an error output indicating that the assembly did not load correctly. QUITE
UNACCEPTABLE, Microsoft. I wasted at least two weeks on this.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
QUESTION: What on EARTH would disable the virtualness of a virtual method
except something (??) among the few lines of code that I posted?

There is NO WAY that the other code, the business rules, which has NOTHING to do with virtualness of the method, has anything to do with this problem.
This IS a bug in the Framework.

I have decided to make the method abstract.

Jon
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in

message
news:ug*************@TK2MSFTNGP10.phx.gbl...
Jon,
Go the other direction!

Start a new solution with two projects. The first project loads the second project and calls the virtual method. Include the minimalist amount of

code
to demonstrate the feature. Does it work?

Start adding features from your larger project, until this new project
fails. Baby steps! Add things one at a time. Hopefully when you added X, it
fails, then you know to look at X in the larger project.

This helps solves two problems.
1. It gives you a reference point to compare to the larger project.
2. It proves what you are attempting to do works, or doesn't work. Without being bothered by the shear volume of the rest of your main project.

3. It also provides a small project that fails, which is what Jon
Skeet
was
asking for.

Hope this helps
Jay

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
> I should point out that my project is not currently open source and
as such
> it is private. I am not going to post the entire project nor link to

it, it
> would be a waste of your time anyway (Mr. Skeet).
>
> I should also point out that I cannot simply remove code until the

problem
> fixes itself.
>
> 1. I don't know what to delete.
> 2. If I do delete anything, it will break the entire project.
> 3. I cannot simply paste the code into a new project because there are far
> too many interdependent classes and types and methods, etc.
>
> Finally, I should point out that, while we must try to be respectful to > those who help, those who help should be respectful of these (above)
> hindrances. I've done the best I can to provide what I know without
posting
> a link to the entire solution in a .zip file, short of rewriting code from
> scratch on this matter, which, as I said, will negate the usefulness
of this
> group.
>
> Seems I have no choice, which is fine. Nobody owes me anything.
>
> Thanks again for the willingness to try to help. Please put your
tired self
> to rest.
>
> Jon
>
>
> "Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
> news:um****************@tk2msftngp13.phx.gbl...
> > Jon, it took me about half an hour to hand-pick the relevant lines of code
> > that would be useful to you. You are insistent on not visually
evaluating
> > what I wrote, which is your prerogative.
> >
> > Developing sample code that reproduces the problem is only possible
if
you
> > know how to reproduce the problem, and I don't know how to
reproduce the
> > problem. Obviously if someone in this group cannot help me drill down
to
> the
> > problem with the information I provided and without a full reproduction,
> > then, in order to provide a reproduction of the problem, I will

have to
> > rewrite from the ground up, adding line by line what I've done, until
I
> > discover the culprit (hence, I find what makes it reproduceable).

But that
> > will take days, and by the time I find the culprit I won't need
this > > newsgroup.
> >
> > Thanks anyway.
> >
> > Jon
> >
> >
> > "Jon Skeet" <sk***@pobox.com> wrote in message
> > news:MP************************@news.microsoft.com ...
> > > Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> > > > > But there was - if you'd posted a short but complete example

which
> > > > > *wasn't* working on your box,
> > > >
> > > > But see I couldn't do that without giving you everything.
> > >
> > > But you could. You could have reduced the code gradually (a copy

of the
> > > code, rather) until it worked. That would actually have shown you the
> > > error very quickly (see below) due to what the problem turned
out to > > > be. If the problem *had* been in the code, however, you would
then have
> > > found it when it went from "not working" to "working". Either way, > > > you'd have found the problem in the end.
> > >
> > > > There was absolutely no way to help you help me by reproducing
sample
> > code
> > > > in new project code because I wouldn't have repeated the same

error
> > (unless
> > > > per chance I actually caught myself along the way).
> > >
> > > Which you should have done, because immediately after copying the
full
> > > code, the first thing to do would be to test that it still
didn't work.
> > >
> > > > Thanks again for your insightful question (re your previous

post, > > "Release
> > > > mode"), it actually really helped me drill down to the

problem, and
> > frankly
> > > > I don't know how else I would have found my error.
> > >
> > > See above.
> > >
> > > --
> > > Jon Skeet - <sk***@pobox.com>
> > > http://www.pobox.com/~skeet/
> > > If replying to the group, please do not mail me too
> >
> >
>
>



Nov 15 '05 #24

P: n/a
Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
Yes, the code is basically unchanged; the things that I changed have been
reverted and all is working fine. The problem is that the assemblies were
not loading correctly. This is definitely a bug in one of Microsoft's
tools--the base class should not have executed upon calling the method of a
child class in an invalid / improperly loaded assembly, rather an execution
engine error should have occurred.
Are you absolutely sure that it was the *loading* that was flawed
instead of the copying of the assembly in the first place? To me it
sounds more likely that you had an old copy of the assembly where
either the method wasn't virtual in the base class or wasn't overridden
in the derived class, and that copy was (possibly incorrectly) "in
use" so couldn't be overwritten.
An unidentified, inexplicable execution error *did* occur, however, a few
days ago when I tried calling the method manually from the Type object. That
was certainly better than executing the base object.


I'd be interested in knowing exactly what the situation was in that
case, and what the execution error was.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #25

P: n/a
If you have a similar problem you can try running fuslogvw.exe. If your
problem is related to the runtime being unable to locate an assembly this
tool may help track down the problem.
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:ON**************@TK2MSFTNGP11.phx.gbl...
It is possible that an obsolete DLL, wherein a child class did NOT override the parent class's virtual method, was being loaded from an unexpected
directory (my app does scan from more than one place). However, I cannot
verify this; all files were deleted during the process of finding the
solution.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:Of*************@TK2MSFTNGP10.phx.gbl...
Yes, the code is basically unchanged; the things that I changed have been
reverted and all is working fine. The problem is that the assemblies were not loading correctly. This is definitely a bug in one of Microsoft's
tools--the base class should not have executed upon calling the method of
a
child class in an invalid / improperly loaded assembly, rather an execution
engine error should have occurred.

An unidentified, inexplicable execution error *did* occur, however, a

few days ago when I tried calling the method manually from the Type object.

That
was certainly better than executing the base object.

Jon

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
Okay, making it abstract did help me identify that this was an assembly loading problem. I have fixed the assembly loading problem and the problem is resolved--the child class is FINALLY being executed, even after

reverting
back to virtual (YAAAAY!!).

I still perceive this to be a flaw in the Framework. There should have

been
an error output indicating that the assembly did not load correctly. QUITE UNACCEPTABLE, Microsoft. I wasted at least two weeks on this.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
> QUESTION: What on EARTH would disable the virtualness of a virtual

method
> except something (??) among the few lines of code that I posted?
>
> There is NO WAY that the other code, the business rules, which has

NOTHING
> to do with virtualness of the method, has anything to do with this
problem.
> This IS a bug in the Framework.
>
> I have decided to make the method abstract.
>
> Jon
>
>
> "Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in
message
> news:ug*************@TK2MSFTNGP10.phx.gbl...
> > Jon,
> > Go the other direction!
> >
> > Start a new solution with two projects. The first project loads the second
> > project and calls the virtual method. Include the minimalist amount of
> code
> > to demonstrate the feature. Does it work?
> >
> > Start adding features from your larger project, until this new project > > fails. Baby steps! Add things one at a time. Hopefully when you added
X,
> it
> > fails, then you know to look at X in the larger project.
> >
> > This helps solves two problems.
> > 1. It gives you a reference point to compare to the larger
project. > > 2. It proves what you are attempting to do works, or doesn't work.
Without
> > being bothered by the shear volume of the rest of your main project. > >
> > 3. It also provides a small project that fails, which is what Jon

Skeet
> was
> > asking for.
> >
> > Hope this helps
> > Jay
> >
> > "Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
> > news:Ot**************@tk2msftngp13.phx.gbl...
> > > I should point out that my project is not currently open source

and
as
> > such
> > > it is private. I am not going to post the entire project nor link to it,
> > it
> > > would be a waste of your time anyway (Mr. Skeet).
> > >
> > > I should also point out that I cannot simply remove code until
the > problem
> > > fixes itself.
> > >
> > > 1. I don't know what to delete.
> > > 2. If I do delete anything, it will break the entire project.
> > > 3. I cannot simply paste the code into a new project because

there are
> > far
> > > too many interdependent classes and types and methods, etc.
> > >
> > > Finally, I should point out that, while we must try to be respectful to
> > > those who help, those who help should be respectful of these (above) > > > hindrances. I've done the best I can to provide what I know without > > posting
> > > a link to the entire solution in a .zip file, short of rewriting

code
> from
> > > scratch on this matter, which, as I said, will negate the usefulness
of
> > this
> > > group.
> > >
> > > Seems I have no choice, which is fine. Nobody owes me anything.
> > >
> > > Thanks again for the willingness to try to help. Please put your

tired
> > self
> > > to rest.
> > >
> > > Jon
> > >
> > >
> > > "Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
> > > news:um****************@tk2msftngp13.phx.gbl...
> > > > Jon, it took me about half an hour to hand-pick the relevant

lines of
> > code
> > > > that would be useful to you. You are insistent on not visually
> > evaluating
> > > > what I wrote, which is your prerogative.
> > > >
> > > > Developing sample code that reproduces the problem is only

possible
if
> > you
> > > > know how to reproduce the problem, and I don't know how to

reproduce
> the
> > > > problem. Obviously if someone in this group cannot help me drill down
> to
> > > the
> > > > problem with the information I provided and without a full
> reproduction,
> > > > then, in order to provide a reproduction of the problem, I will have
> to
> > > > rewrite from the ground up, adding line by line what I've
done, until
> I
> > > > discover the culprit (hence, I find what makes it reproduceable). But
> > that
> > > > will take days, and by the time I find the culprit I won't need this
> > > > newsgroup.
> > > >
> > > > Thanks anyway.
> > > >
> > > > Jon
> > > >
> > > >
> > > > "Jon Skeet" <sk***@pobox.com> wrote in message
> > > > news:MP************************@news.microsoft.com ...
> > > > > Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> > > > > > > But there was - if you'd posted a short but complete example > which
> > > > > > > *wasn't* working on your box,
> > > > > >
> > > > > > But see I couldn't do that without giving you everything.
> > > > >
> > > > > But you could. You could have reduced the code gradually (a copy of
> > the
> > > > > code, rather) until it worked. That would actually have
shown
you
> the
> > > > > error very quickly (see below) due to what the problem
turned out
to
> > > > > be. If the problem *had* been in the code, however, you
would then
> > have
> > > > > found it when it went from "not working" to "working".
Either way,
> > > > > you'd have found the problem in the end.
> > > > >
> > > > > > There was absolutely no way to help you help me by reproducing > > sample
> > > > code
> > > > > > in new project code because I wouldn't have repeated the same > error
> > > > (unless
> > > > > > per chance I actually caught myself along the way).
> > > > >
> > > > > Which you should have done, because immediately after

copying the
> full
> > > > > code, the first thing to do would be to test that it still

didn't
> > work.
> > > > >
> > > > > > Thanks again for your insightful question (re your

previous post,
> > > > "Release
> > > > > > mode"), it actually really helped me drill down to the

problem,
> and
> > > > frankly
> > > > > > I don't know how else I would have found my error.
> > > > >
> > > > > See above.
> > > > >
> > > > > --
> > > > > Jon Skeet - <sk***@pobox.com>
> > > > > http://www.pobox.com/~skeet/
> > > > > If replying to the group, please do not mail me too
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #26

P: n/a
Ah but it did load an assembly and the assembly's class did inherit my base
object and it recognized my type and loaded it as such, it was just
executing the base instance of a virtual method, so I didn't know whether
this was an assembly loading problem ..

I really don't know what happened, but I do know that if it loaded an
obsolete assembly--something I feared for days, but didn't bother to look
further into it until the problem was found--then that would make a lot of
sense and explain the problem: the obsolete assembly's child class didn't
override the virtual method.

What a nrrrrrd I am ....

Jon
"Dave" <kd******@wi.rr.com> wrote in message
news:OY**************@tk2msftngp13.phx.gbl...
If you have a similar problem you can try running fuslogvw.exe. If your
problem is related to the runtime being unable to locate an assembly this
tool may help track down the problem.
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:ON**************@TK2MSFTNGP11.phx.gbl...
It is possible that an obsolete DLL, wherein a child class did NOT

override
the parent class's virtual method, was being loaded from an unexpected
directory (my app does scan from more than one place). However, I cannot
verify this; all files were deleted during the process of finding the
solution.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:Of*************@TK2MSFTNGP10.phx.gbl...
Yes, the code is basically unchanged; the things that I changed have been reverted and all is working fine. The problem is that the assemblies were not loading correctly. This is definitely a bug in one of Microsoft's
tools--the base class should not have executed upon calling the method of
a
child class in an invalid / improperly loaded assembly, rather an

execution
engine error should have occurred.

An unidentified, inexplicable execution error *did* occur, however, a few days ago when I tried calling the method manually from the Type object. That
was certainly better than executing the base object.

Jon

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
> Okay, making it abstract did help me identify that this was an assembly > loading problem. I have fixed the assembly loading problem and the

problem
> is resolved--the child class is FINALLY being executed, even after
reverting
> back to virtual (YAAAAY!!).
>
> I still perceive this to be a flaw in the Framework. There should
have been
> an error output indicating that the assembly did not load correctly.

QUITE
> UNACCEPTABLE, Microsoft. I wasted at least two weeks on this.
>
> Jon
>
>
> "Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
> news:%2***************@tk2msftngp13.phx.gbl...
> > QUESTION: What on EARTH would disable the virtualness of a virtual
method
> > except something (??) among the few lines of code that I posted?
> >
> > There is NO WAY that the other code, the business rules, which has
NOTHING
> > to do with virtualness of the method, has anything to do with this
> problem.
> > This IS a bug in the Framework.
> >
> > I have decided to make the method abstract.
> >
> > Jon
> >
> >
> > "Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in > message
> > news:ug*************@TK2MSFTNGP10.phx.gbl...
> > > Jon,
> > > Go the other direction!
> > >
> > > Start a new solution with two projects. The first project loads the > second
> > > project and calls the virtual method. Include the minimalist amount
of
> > code
> > > to demonstrate the feature. Does it work?
> > >
> > > Start adding features from your larger project, until this new

project
> > > fails. Baby steps! Add things one at a time. Hopefully when you

added
X,
> > it
> > > fails, then you know to look at X in the larger project.
> > >
> > > This helps solves two problems.
> > > 1. It gives you a reference point to compare to the larger

project. > > > 2. It proves what you are attempting to do works, or doesn't work. > Without
> > > being bothered by the shear volume of the rest of your main project. > > >
> > > 3. It also provides a small project that fails, which is what Jon Skeet
> > was
> > > asking for.
> > >
> > > Hope this helps
> > > Jay
> > >
> > > "Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
> > > news:Ot**************@tk2msftngp13.phx.gbl...
> > > > I should point out that my project is not currently open source and
as
> > > such
> > > > it is private. I am not going to post the entire project nor link
to
> it,
> > > it
> > > > would be a waste of your time anyway (Mr. Skeet).
> > > >
> > > > I should also point out that I cannot simply remove code until the > > problem
> > > > fixes itself.
> > > >
> > > > 1. I don't know what to delete.
> > > > 2. If I do delete anything, it will break the entire
project. > > > > 3. I cannot simply paste the code into a new project because

there
> are
> > > far
> > > > too many interdependent classes and types and methods, etc.
> > > >
> > > > Finally, I should point out that, while we must try to be

respectful
> to
> > > > those who help, those who help should be respectful of these

(above)
> > > > hindrances. I've done the best I can to provide what I know

without
> > > posting
> > > > a link to the entire solution in a .zip file, short of rewriting code
> > from
> > > > scratch on this matter, which, as I said, will negate the

usefulness

> of
> > > this
> > > > group.
> > > >
> > > > Seems I have no choice, which is fine. Nobody owes me anything. > > > >
> > > > Thanks again for the willingness to try to help. Please put your tired
> > > self
> > > > to rest.
> > > >
> > > > Jon
> > > >
> > > >
> > > > "Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message > > > > news:um****************@tk2msftngp13.phx.gbl...
> > > > > Jon, it took me about half an hour to hand-pick the relevant

lines
> of
> > > code
> > > > > that would be useful to you. You are insistent on not visually > > > evaluating
> > > > > what I wrote, which is your prerogative.
> > > > >
> > > > > Developing sample code that reproduces the problem is only
possible
> if
> > > you
> > > > > know how to reproduce the problem, and I don't know how to
reproduce
> > the
> > > > > problem. Obviously if someone in this group cannot help me

drill > down
> > to
> > > > the
> > > > > problem with the information I provided and without a full
> > reproduction,
> > > > > then, in order to provide a reproduction of the problem, I will have
> > to
> > > > > rewrite from the ground up, adding line by line what I've done, > until
> > I
> > > > > discover the culprit (hence, I find what makes it

reproduceable).
> But
> > > that
> > > > > will take days, and by the time I find the culprit I won't need this
> > > > > newsgroup.
> > > > >
> > > > > Thanks anyway.
> > > > >
> > > > > Jon
> > > > >
> > > > >
> > > > > "Jon Skeet" <sk***@pobox.com> wrote in message
> > > > > news:MP************************@news.microsoft.com ...
> > > > > > Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> > > > > > > > But there was - if you'd posted a short but complete

example
> > which
> > > > > > > > *wasn't* working on your box,
> > > > > > >
> > > > > > > But see I couldn't do that without giving you everything. > > > > > >
> > > > > > But you could. You could have reduced the code gradually
(a copy
> of
> > > the
> > > > > > code, rather) until it worked. That would actually have

shown you
> > the
> > > > > > error very quickly (see below) due to what the problem turned out
> to
> > > > > > be. If the problem *had* been in the code, however, you would then
> > > have
> > > > > > found it when it went from "not working" to "working". Either way,
> > > > > > you'd have found the problem in the end.
> > > > > >
> > > > > > > There was absolutely no way to help you help me by

reproducing
> > > sample
> > > > > code
> > > > > > > in new project code because I wouldn't have repeated the

same
> > error
> > > > > (unless
> > > > > > > per chance I actually caught myself along the way).
> > > > > >
> > > > > > Which you should have done, because immediately after copying the
> > full
> > > > > > code, the first thing to do would be to test that it still
didn't
> > > work.
> > > > > >
> > > > > > > Thanks again for your insightful question (re your previous > post,
> > > > > "Release
> > > > > > > mode"), it actually really helped me drill down to the
problem,
> > and
> > > > > frankly
> > > > > > > I don't know how else I would have found my error.
> > > > > >
> > > > > > See above.
> > > > > >
> > > > > > --
> > > > > > Jon Skeet - <sk***@pobox.com>
> > > > > > http://www.pobox.com/~skeet/
> > > > > > If replying to the group, please do not mail me too
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #27

P: n/a
Jon,
That's a good question! I do what you are asking in 3 or 4 projects. I have
yet to see it fail.

Rather than loading the assembly, I normally use Type.GetType to load the
type & assembly at one time. This will either return my type or throw an
exception. I have yet to see it return null.

I then use Activator.CreateInstance to create an instance, of the above
type.

For the Type.GetType method, I pass a string in the form
"mynamespace.mytype, myassembly".

As you may have found there are at least three ways to dynamically create
objects in .NET.

Glad you got it to work!

Hope this helps
Jay

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
QUESTION: What on EARTH would disable the virtualness of a virtual method
except something (??) among the few lines of code that I posted?

There is NO WAY that the other code, the business rules, which has NOTHING
to do with virtualness of the method, has anything to do with this problem. This IS a bug in the Framework.

I have decided to make the method abstract.

Jon
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message news:ug*************@TK2MSFTNGP10.phx.gbl...
Jon,
Go the other direction!

Start a new solution with two projects. The first project loads the second
project and calls the virtual method. Include the minimalist amount of code
to demonstrate the feature. Does it work?

Start adding features from your larger project, until this new project
fails. Baby steps! Add things one at a time. Hopefully when you added X,

it
fails, then you know to look at X in the larger project.

This helps solves two problems.
1. It gives you a reference point to compare to the larger project.
2. It proves what you are attempting to do works, or doesn't work. Without being bothered by the shear volume of the rest of your main project.

3. It also provides a small project that fails, which is what Jon Skeet

was
asking for.

Hope this helps
Jay

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
I should point out that my project is not currently open source and as

such
it is private. I am not going to post the entire project nor link to it,
it
would be a waste of your time anyway (Mr. Skeet).

I should also point out that I cannot simply remove code until the problem fixes itself.

1. I don't know what to delete.
2. If I do delete anything, it will break the entire project.
3. I cannot simply paste the code into a new project because there
are far
too many interdependent classes and types and methods, etc.

Finally, I should point out that, while we must try to be respectful
to those who help, those who help should be respectful of these (above)
hindrances. I've done the best I can to provide what I know without

posting
a link to the entire solution in a .zip file, short of rewriting code

from scratch on this matter, which, as I said, will negate the usefulness of this
group.

Seems I have no choice, which is fine. Nobody owes me anything.

Thanks again for the willingness to try to help. Please put your tired

self
to rest.

Jon
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:um****************@tk2msftngp13.phx.gbl...
> Jon, it took me about half an hour to hand-pick the relevant lines
of
code
> that would be useful to you. You are insistent on not visually

evaluating
> what I wrote, which is your prerogative.
>
> Developing sample code that reproduces the problem is only possible
if you
> know how to reproduce the problem, and I don't know how to reproduce the > problem. Obviously if someone in this group cannot help me drill
down to the
> problem with the information I provided and without a full reproduction, > then, in order to provide a reproduction of the problem, I will have to > rewrite from the ground up, adding line by line what I've done,
until
I > discover the culprit (hence, I find what makes it reproduceable).
But that
> will take days, and by the time I find the culprit I won't need this
> newsgroup.
>
> Thanks anyway.
>
> Jon
>
>
> "Jon Skeet" <sk***@pobox.com> wrote in message
> news:MP************************@news.microsoft.com ...
> > Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote:
> > > > But there was - if you'd posted a short but complete example which > > > > *wasn't* working on your box,
> > >
> > > But see I couldn't do that without giving you everything.
> >
> > But you could. You could have reduced the code gradually (a copy
of the
> > code, rather) until it worked. That would actually have shown you

the > > error very quickly (see below) due to what the problem turned out
to > > be. If the problem *had* been in the code, however, you would then

have
> > found it when it went from "not working" to "working". Either way,
> > you'd have found the problem in the end.
> >
> > > There was absolutely no way to help you help me by reproducing

sample
> code
> > > in new project code because I wouldn't have repeated the same

error > (unless
> > > per chance I actually caught myself along the way).
> >
> > Which you should have done, because immediately after copying the full > > code, the first thing to do would be to test that it still didn't

work.
> >
> > > Thanks again for your insightful question (re your previous post, > "Release
> > > mode"), it actually really helped me drill down to the problem, and > frankly
> > > I don't know how else I would have found my error.
> >
> > See above.
> >
> > --
> > Jon Skeet - <sk***@pobox.com>
> > http://www.pobox.com/~skeet/
> > If replying to the group, please do not mail me too
>
>



Nov 15 '05 #28

P: n/a
-----Original Message-----
Thanks for the feedback, Jay, I'll consider your advice. And thanks for notbeating me over the head like some other people have done in the past fornot doing things their way.

Jon
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in messagenews:ug*************@TK2MSFTNGP10.phx.gbl...
Jon,
Go the other direction!

Start a new solution with two projects. The first project loads the second
project and calls the virtual method. Include the minimalist amount of
code
to demonstrate the feature. Does it work?

Start adding features from your larger project, until
this new project fails. Baby steps! Add things one at a time. Hopefully when you added X,it
fails, then you know to look at X in the larger
project.
This helps solves two problems.
1. It gives you a reference point to compare to the larger project. 2. It proves what you are attempting to do works, or doesn't work. Without being bothered by the shear volume of the rest of your main project.
3. It also provides a small project that fails, which is what Jon Skeetwas
asking for.

Hope this helps
Jay

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote
in message news:Ot**************@tk2msftngp13.phx.gbl...
> I should point out that my project is not currently open source and as
such
> it is private. I am not going to post the entire
project nor link to it, it
> would be a waste of your time anyway (Mr. Skeet).
>
> I should also point out that I cannot simply remove
code until theproblem > fixes itself.
>
> 1. I don't know what to delete.
> 2. If I do delete anything, it will break the
entire project. > 3. I cannot simply paste the code into a new project because there are far
> too many interdependent classes and types and
methods, etc. >
> Finally, I should point out that, while we must try to be respectful to > those who help, those who help should be respectful of these (above) > hindrances. I've done the best I can to provide what I know without posting
> a link to the entire solution in a .zip file, short
of rewriting code
from > scratch on this matter, which, as I said, will
negate the usefulness of this
> group.
>
> Seems I have no choice, which is fine. Nobody owes
me anything. >
> Thanks again for the willingness to try to help. Please put your tired self
> to rest.
>
> Jon
>
>
> "Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net>
wrote in message > news:um****************@tk2msftngp13.phx.gbl...
> > Jon, it took me about half an hour to hand-pick the relevant lines of code
> > that would be useful to you. You are insistent on
not visually evaluating
> > what I wrote, which is your prerogative.
> >
> > Developing sample code that reproduces the problem
is only possible if you
> > know how to reproduce the problem, and I don't
know how to reproduce
the > > problem. Obviously if someone in this group cannot
help me drill down
to > the
> > problem with the information I provided and
without a full
reproduction, > > then, in order to provide a reproduction of the
problem, I will have
to > > rewrite from the ground up, adding line by line
what I've done, until
I > > discover the culprit (hence, I find what makes it
reproduceable). But that
> > will take days, and by the time I find the culprit
I won't need this > > newsgroup.
> >
> > Thanks anyway.
> >
> > Jon
> >
> >
> > "Jon Skeet" <sk***@pobox.com> wrote in message
> > news:MP************************@news.microsoft.com ... > > > Jon Davis <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote: > > > > > But there was - if you'd posted a short but complete example
which > > > > > *wasn't* working on your box,
> > > >
> > > > But see I couldn't do that without giving you
everything. > > >
> > > But you could. You could have reduced the code gradually (a copy of the
> > > code, rather) until it worked. That would
actually have shown you
the > > > error very quickly (see below) due to what the
problem turned out to > > > be. If the problem *had* been in the code, however, you would then have
> > > found it when it went from "not working"
to "working". Either way, > > > you'd have found the problem in the end.
> > >
> > > > There was absolutely no way to help you help me by reproducing sample
> > code
> > > > in new project code because I wouldn't have
repeated the same
error > > (unless
> > > > per chance I actually caught myself along the
way). > > >
> > > Which you should have done, because immediately after copying the
full > > > code, the first thing to do would be to test
that it still didn't work.
> > >
> > > > Thanks again for your insightful question (re
your previous post, > > "Release
> > > > mode"), it actually really helped me drill down to the problem,and > > frankly
> > > > I don't know how else I would have found my

error. > > >
> > > See above.
> > >
> > > --
> > > Jon Skeet - <sk***@pobox.com>
> > > http://www.pobox.com/~skeet/
> > > If replying to the group, please do not mail me too > >
> >
>
>


.

Nov 15 '05 #29

This discussion thread is closed

Replies have been disabled for this discussion.