Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IComparer and Sort

3 views
Skip to first unread message

coder316

unread,
Nov 5, 2009, 10:49:52 AM11/5/09
to
Hello,
I am trying to find (and understand) the connection between CompareTo
and Sort. When I call Sort, it calls my implementation of CompareTo,
but I dont see a connection in the object browser.
Thanks

Jeff Johnson

unread,
Nov 5, 2009, 11:48:04 AM11/5/09
to
"coder316" <code...@gmail.com> wrote in message
news:3445d705-166b-4449...@m26g2000yqb.googlegroups.com...

> I am trying to find (and understand) the connection between CompareTo
> and Sort. When I call Sort

...on what?

> it calls my implementation of CompareTo,
> but I dont see a connection in the object browser.

The "connection" is in the code of whatever object you're calling Sort() on.


coder316

unread,
Nov 5, 2009, 12:39:12 PM11/5/09
to
On Nov 5, 11:48 am, "Jeff Johnson" <i....@enough.spam> wrote:
> "coder316" <coder...@gmail.com> wrote in message

When I call this:
Array.Sort(blah);
This gets run:
public int CompareTo(object obj) // Implement the method.
{
MyClass mc = (MyClass)obj;
if (this.TheValue < mc.TheValue) return -1;
if (this.TheValue > mc.TheValue) return 1;
return 0;
}
I know theres a heirarchy of calls being made, but I cant find hem.
Anybody with an Explanation?

Jeff Johnson

unread,
Nov 5, 2009, 1:46:23 PM11/5/09
to
"coder316" <code...@gmail.com> wrote in message
news:d3d3d40d-e381-485e...@l2g2000yqd.googlegroups.com...

> When I call this:
> Array.Sort(blah);
> This gets run:
> public int CompareTo(object obj) // Implement the method.
> {
> MyClass mc = (MyClass)obj;
> if (this.TheValue < mc.TheValue) return -1;
> if (this.TheValue > mc.TheValue) return 1;
> return 0;
> }
> I know theres a heirarchy of calls being made, but I cant find hem.
> Anybody with an Explanation?

http://www.red-gate.com/products/reflector/

coder316

unread,
Nov 5, 2009, 2:22:21 PM11/5/09
to
On Nov 5, 1:46 pm, "Jeff Johnson" <i....@enough.spam> wrote:
> "coder316" <coder...@gmail.com> wrote in message

I know your trying to help me find it myself, and for most things,
that works,but a good explanation ala Peter Duniho or Nicholas Paldino
would go along way.
Sometimes there is just one little link missing in our understanding
of things.
I know about IComparer and Array.Sort and interfaces in general, but
this one roundabout way of going from Sort to CompareTo is slipping
through.
Thanks


Thanks

coder316

unread,
Nov 5, 2009, 2:57:06 PM11/5/09
to
> Thanks- Hide quoted text -
>
> - Show quoted text -

By the way Jeff,
Thats a great piece of software.
Thanks

Jeff Johnson

unread,
Nov 5, 2009, 3:09:07 PM11/5/09
to
"coder316" <code...@gmail.com> wrote in message
news:47be212c-8431-4c11...@r24g2000yqd.googlegroups.com...

> I know your trying to help me find it myself, and for most things,
> that works,but a good explanation ala Peter Duniho or Nicholas Paldino
> would go along way.

I guess that's why I'm an ex-MVP and they're still current!

Seriously, I fired up Reflector hoping to post the code that called
CompareTo(), but it ended up being so complex that I decided I just didn't
feel like digging for it and that if you wanted to know so bad you'd find it
for yourself. Besides, using Reflector is an absolutely excellent way of
learning about the .NET framework. It's almost like using the Web: you start
by looking for one specific you find yourself "hyperlinking" through loads
of other functions and then you realize how much of your life you just
burned away. Don't say I didn't warn you....


Harlan Messinger

unread,
Nov 5, 2009, 3:42:04 PM11/5/09
to

Naturally the object browser isn't showing you what you're looking for.
It doesn't show you what methods DO with the objects supplied as call
arguments or that are member data of the objects to which the methods
belonging. It doesn't show you which methods a method calls.

Array knows what its elements are. If the elements implement IComparer,
the array's Sort method is able to call the elements' CompareTo methods,
so it can compare them to each other and sort them. Does that cover what
you weren't understanding, or is there anything else?

Jeff Johnson

unread,
Nov 5, 2009, 4:21:57 PM11/5/09
to
"Jeff Johnson" <i....@enough.spam> wrote in message
news:%23CHWWPl...@TK2MSFTNGP04.phx.gbl...

> "coder316" <code...@gmail.com> wrote in message
> news:47be212c-8431-4c11...@r24g2000yqd.googlegroups.com...
>
>> I know your trying to help me find it myself, and for most things,
>> that works,but a good explanation ala Peter Duniho or Nicholas Paldino
>> would go along way.
>
> I guess that's why I'm an ex-MVP and they're still current!
>
> Seriously, I fired up Reflector hoping to post the code that called
> CompareTo(), but it ended up being so complex that I decided I just didn't
> feel like digging for it and that if you wanted to know so bad you'd find
> it for yourself. Besides, using Reflector is an absolutely excellent way
> of learning about the .NET framework. It's almost like using the Web: you
> start by looking for one specific

thing and then

> you find yourself "hyperlinking" through loads of other functions and then
> you realize how much of your life you just burned away. Don't say I didn't
> warn you....

(Dropped a few words there....)


Tony Johansson

unread,
Nov 5, 2009, 5:20:02 PM11/5/09
to
Here I have a copy from the call stack that show something about the call
sequence.
What I don't understand here is how a call to Compare can call CompareTo

ConsoleApplication7.exe!Person.CompareTo(object obj = {Person}) Line 32 C#
mscorlib.dll!System.Collections.Comparer.Compare(object a, object b) + 0x5f
bytes
mscorlib.dll!System.Array.SorterObjectArray.SwapIfGreaterWithItems(int a =
0, int b = 2) + 0x59 bytes
mscorlib.dll!System.Array.SorterObjectArray.QuickSort(int left = 0, int
right = 4) + 0x40 bytes
mscorlib.dll!System.Array.Sort(System.Array keys, System.Array items, int
index, int length, System.Collections.IComparer comparer) + 0x117 bytes
mscorlib.dll!System.Collections.ArrayList.Sort(int index, int count,
System.Collections.IComparer comparer) + 0x38 bytes
mscorlib.dll!System.Collections.ArrayList.Sort() + 0x2f bytes
ConsoleApplication7.exe!Program.Main(string[] args = {Dimensions:[0]}) Line
16 + 0xb bytes

//Tony


"Harlan Messinger" <hmessinger...@comcast.net> skrev i meddelandet
news:7lgrktF...@mid.individual.net...

AMP

unread,
Nov 5, 2009, 5:37:23 PM11/5/09
to
On Nov 5, 5:20 pm, "Tony Johansson" <johansson.anders...@telia.com>
wrote:

> Here I have a copy from the call stack that show something about the call
> sequence.
> What I don't understand here is how a call to Compare can call CompareTo
>
> ConsoleApplication7.exe!Person.CompareTo(object obj = {Person}) Line 32 C#
> mscorlib.dll!System.Collections.Comparer.Compare(object a, object b) + 0x5f
> bytes
> mscorlib.dll!System.Array.SorterObjectArray.SwapIfGreaterWithItems(int a =
> 0, int b = 2) + 0x59 bytes
> mscorlib.dll!System.Array.SorterObjectArray.QuickSort(int left = 0, int
> right = 4) + 0x40 bytes
> mscorlib.dll!System.Array.Sort(System.Array keys, System.Array items, int
> index, int length, System.Collections.IComparer comparer) + 0x117 bytes
> mscorlib.dll!System.Collections.ArrayList.Sort(int index, int count,
> System.Collections.IComparer comparer) + 0x38 bytes
> mscorlib.dll!System.Collections.ArrayList.Sort() + 0x2f bytes
> ConsoleApplication7.exe!Program.Main(string[] args = {Dimensions:[0]}) Line
> 16 + 0xb bytes
>
> //Tony
>
> "Harlan Messinger" <hmessinger.removet...@comcast.net> skrev i meddelandetnews:7lgrktF...@mid.individual.net...
> > you weren't understanding, or is there anything else?- Hide quoted text -

>
> - Show quoted text -

Jeff,
Interesting.. I didnt see the missing words, but people have the
ability of filling in missing words.
Theres a little paragraph out there where all the words are spelled
completely wrong but you could still read it.
Go Figure.
Harlan,
Thanks Also. I'm starting to "get it"

Peter Duniho

unread,
Nov 5, 2009, 5:38:20 PM11/5/09
to

It's difficult to provide an exact explanation without knowing exactly
what your experience level is, and what your specific question is. But,
making some assumptions:

-- When you call Array.Sort(), that method has to do comparisons
between the elements of the array

-- One way to define a comparison between objects is to implement
IComparable

-- Through the magic of polymorphism, each time Array.Sort() wants
to know whether a given object is "less than", "greater than", or "equal
to" another given object, and those objects implement IComparable,
Array.Sort() can just cast the object reference to IComparable and call
the CompareTo() method in that interface.

Depending on how much you know about sorting algorithms and
polymorphism, the above may or may not make sense. Also depending on
what your actual question is, the above may or may not actually address
what you're asking.

I'm also not clear on why you are asking about the object browser. If
you're looking for "a hierarchy of calls", that's a run-time thing that
you can look at in the debugger. But the object browser doesn't know
anything about that. It just shows you the members of classes and the
relationships between class _declarations_, not run-time relationships
related to the execution of code.

If the above doesn't answer the question, you should consider trying to
be more specific, rephrasing the question so it's more clear exactly
what you don't understand.

Pete

Peter Duniho

unread,
Nov 5, 2009, 5:45:00 PM11/5/09
to
Tony Johansson wrote:
> Here I have a copy from the call stack that show something about the call
> sequence.
> What I don't understand here is how a call to Compare can call CompareTo

int Compare(object a, object b)
{
return ((IComparable)a).CompareTo(b);
}

Obviously, "a" has to implement IComparable for that to work.

Pete

Message has been deleted
Message has been deleted

coder316

unread,
Nov 6, 2009, 7:41:39 AM11/6/09
to
On Nov 5, 5:45 pm, Peter Duniho <no.peted.s...@no.nwlink.spam.com>
wrote:

Pete,
Thanks. I think whats holding me up is that there is no direct call to
CompareTo from anywhere, or am I missing something.
Is it because it's the only Method of IComparable?

coder316

unread,
Nov 6, 2009, 8:18:50 AM11/6/09
to

In the following code I am declaring and useing an interface.Its
pretty strait forward.This is my understanding of how it works.
But as you can see, I'm calling AddNumbers. I cant see the roundabout
way it's getting done in CompareTo.
Thats what I'm having a problem with.
namespace Interface2
{
interface MyInterface
{
int AddNumbers(int x, int y);
}
class Program
{
static void Main(string[] args)
{
UseInterface useinterface = new UseInterface();
Console.WriteLine(useinterface.AddNumbers(2,2));
Console.ReadLine();
}
}
class UseInterface:MyInterface
{

public int AddNumbers(int a, int b)
{
int c;
return c = a + b;
}

}
}

Harlan Messinger

unread,
Nov 6, 2009, 11:59:38 AM11/6/09
to

There's no such thing as a call that isn't a *direct* call by *something*.

> Is it because it's the only Method of IComparable?

It's because Compare calls it, as Pete showed you. And Sort calls
Compare, directly or indirectly.

coder316

unread,
Nov 6, 2009, 12:44:57 PM11/6/09
to
On Nov 6, 11:59 am, Harlan Messinger
> Compare, directly or indirectly.- Hide quoted text -

>
> - Show quoted text -

I found this on msdn:
The instance's IComparable implementation is called AUTOMATTICALLY by
methods such as Array.Sort
These calls are going on behind the scenes and as Jeff mentioned I
could walk my way through it in the Disassembler, taking several steps
(as the call stack shows) to get from Sort to CompareTo.
Correct?

Harlan Messinger

unread,
Nov 6, 2009, 1:32:40 PM11/6/09
to
You seem to be trying to draw distinctions that don't exist when you
write "automatically" and "behind the scenes". The code a developer
writes will generally call method provided in one or more libraries.
Everything the called library methods do is "automatic", and all of it
is "behind the scenes" insofar as the code inside these library-supplied
methods is invisible to you. This is true whether you call Console.Write
or Encoding.ToString or Form.Show or any other library-supplied method
or property.

Peter Duniho

unread,
Nov 6, 2009, 2:10:26 PM11/6/09
to
coder316 wrote:
>> [...]

>> int Compare(object a, object b)
>> {
>> return ((IComparable)a).CompareTo(b);
>> }
>
> Thanks. I think whats holding me up is that there is no direct call to
> CompareTo from anywhere, or am I missing something.

I don't understand the question. My code shows what I'd call a "direct
call to CompareTo()".

> Is it because it's the only Method of IComparable?

No. IComparable could have as many methods as you want. It's the fact
that in the code example I wrote, I typed the characters "CompareTo" as
the method to call.

I don't know how much more "direct" it could be. :)

Pete

Peter Duniho

unread,
Nov 6, 2009, 2:19:27 PM11/6/09
to
coder316 wrote:
> In the following code I am declaring and useing an interface.Its
> pretty strait forward.

Except that it's not. Yes, you are declaring and implementing an
interface. But you're not _using_ it at all.

A better code example would look like this:

namespace Interface2
{
interface MyInterface
{
int AddNumbers(int x, int y);
}

class Program
{
static void Main(string[] args)
{

MyInterface myinterface = new UseInterface();
Console.WriteLine(myinterface.AddNumbers(2,2));
Console.ReadLine();
}
}

class UseInterface : MyInterface
{

private int MyInterface.AddNumbers(int a, int b)


{
int c;
return c = a + b;
}

}
}

I've made a couple of changes, one very important, one not so important:

-- very important: the variable type is now "MyInterface" rather
than "UseInterface". Typed as the actual object type, you'll have
access to all public members of the type, regardless of interface
implementations. So your previous example wasn't very interesting, as
the interface itself could have been omitted altogether without changing
the behavior of the code (or even whether it would compile!). With the
variable types as "MyInterface", you can add all sorts of other stuff to
"UseInterface", but none of that will show up in the variable
"MyInterface"...you'll still only be able to call the AddNumbers() method.

-- less important: I made the interface implementation "explicit".
That is, the method name is qualified with the interface name. This
means that the _only_ way to call the method is via the interface. You
can't call it with a variable of type "UseInterface"; the expression for
the reference _has_ to be "MyInterface".

The important thing to keep in mind is that when a class implements an
interface, other code can access all the members of the class _that are
included as implementation of that interface_ using only the interface
type itself, without knowing anything else about the class.

That's what happens with the Sort() method. It doesn't need to know
anything about the elements of the array, except that they implement the
IComparable interface. Knowing that, Sort() can simply cast each object
to IComparable, and then call the CompareTo() method declared in the
IComparable interface.

Pete

Peter Duniho

unread,
Nov 6, 2009, 2:30:35 PM11/6/09
to
Tony Johansson wrote:
> Hello!
>
> At the end is a complete program that give the call stack shown below
> I use Red Gate's .NET Reflector on my assembly.
> I can click in the disassembler and follow the sequence of calls that is
> being made up to this call to QuickSort

> mscorlib.dll!System.Array.SorterObjectArray.QuickSort(int left = 0, int
> right = 4) + 0x40 bytes
> I can't understand how this call to SwapIfGreaterWithItems can be made from
> the QuickSort ?

Why can't you understand that? It's no different from any other method
call. Why _wouldn't_ the QuickSort() method be able to call the
SwapIfGreaterWithItems() method?

> And as the last question I have tried to find the call to CompareTo using
> Red Gate's .NET Reflector on my assembly but
> I can't find it

Why not? The stack trace shows you exactly where to find it: in the
System.Collections.Comparer.Compare() method. And when I use Reflector
to examine that method, this is what I see:

public int Compare(object a, object b)
{
if (a == b)
{
return 0;
}
if (a == null)
{
return -1;
}
if (b == null)
{
return 1;
}
if (this.m_compareInfo != null)
{
string str = a as string;
string str2 = b as string;
if ((str != null) && (str2 != null))
{
return this.m_compareInfo.Compare(str, str2);
}
}
IComparable comparable = a as IComparable;
if (comparable == null)
{
throw new
ArgumentException(Environment.GetResourceString("Argument_ImplementIComparable"));
}
return comparable.CompareTo(b);
}

Note the very last lines, starting with the declaration of "comparable".
After all other possibilities are exhausted, the method checks to see
if the object type implements IComparable, and if it does, it calls the
IComparable.CompareTo() method.

> int Compare(object a, object b)
> {
> return ((IComparable)a).CompareTo(b);
> }
>

> I just wonder if some code is hidden in some way so I have not chance to see
> it that
> would explain why I can't find the call to CompareTo

It's not hidden at all.

Pete

coder316

unread,
Nov 6, 2009, 3:03:27 PM11/6/09
to
On Nov 6, 2:19 pm, Peter Duniho <no.peted.s...@no.nwlink.spam.com>
wrote:

Great Explanations,
Thank You!!!

coder316

unread,
Nov 6, 2009, 3:24:29 PM11/6/09
to
> Thank You!!!- Hide quoted text -

>
> - Show quoted text -

One other thing is that all of the online examples and books i"m
working with (Pro C#2008 and the .net Framework) just implement the
interface they way I showed in my example.
They use it as a "This must implement that" . I havent seen where they
just set the reference to the Interface type so that you can only use
the methods implemented by the interface. I like it, but I havent seen
it before.
Thanks

Tony Johansson

unread,
Nov 6, 2009, 8:14:32 PM11/6/09
to
Below is method QuickSort located in System.Array.SorterObjectArray

mscorlib.dll!System.Array.SorterObjectArray.QuickSort(int left = 0, int
right = 4) + 0x40 bytes

According to the stack trace should a call to SwapIfGreaterWithItems be made
from QuickSort


mscorlib.dll!System.Array.SorterObjectArray.SwapIfGreaterWithItems(int a =
0, int b = 2) + 0x59 bytes

There is no call to SwapIfGreaterWithItems in this method QuickSort.
These must be something that I have missed here ?

internal void QuickSort(int left, int right)
{
do
{
int i = left;
int j = right;
object y = this.keys[Array.GetMedian(i, j)];
do
{
try
{
while (this.comparer.Compare(this.keys[i], y) < 0)
{
i++;
}
while (this.comparer.Compare(y, this.keys[j]) < 0)
{
j--;
}
}
catch (IndexOutOfRangeException)
{
throw new ArgumentException();
}
catch (Exception)
{
throw new InvalidOperationException();
}
if (i > j)
{
break;
}
if (i < j)
{
object obj3 = this.keys[i];
this.keys[i] = this.keys[j];
this.keys[j] = obj3;
if (this.items != null)
{
object obj4 = this.items[i];
this.items[i] = this.items[j];
this.items[j] = obj4;
}
}
i++;
j--;
}
while (i <= j);
if ((j - left) <= (right - i))
{
if (left < j)
{
this.QuickSort(left, j);
}
left = i;
}
else
{
if (i < right)
{
this.QuickSort(i, right);
}
right = j;
}
}
while (left < right);
}


Peter Duniho

unread,
Nov 6, 2009, 11:33:30 PM11/6/09
to
Tony Johansson wrote:
> Below is method QuickSort located in System.Array.SorterObjectArray
> mscorlib.dll!System.Array.SorterObjectArray.QuickSort(int left = 0, int
> right = 4) + 0x40 bytes

Obtained from where? Because that's not what I see in Reflector, nor is
it what I see in the original .NET source code. Both versions I look at
have three calls to SwapIfGreaterWithItems(), just after the statement
where GetMedian() is called, and just before the start of the do/while
statement.

Here's an excerpt:

internal void QuickSort(int left, int right)
{
do
{

int low = left;
int hi = right;
int median = Array.GetMedian(low, hi);
this.SwapIfGreaterWithItems(low, median);
this.SwapIfGreaterWithItems(low, hi);
this.SwapIfGreaterWithItems(median, hi);
object y = this.keys[median];
do
{

(Interestingly, it's obvious that the .NET source I'm looking at is not
current for this module, because the source I have has variable names
"i" and "j", rather than the "low" and "hi" that are seen in Reflector).

If you're not seeing the call to SwapIfGreaterWithItems(), it's simply
because you're looking in the wrong place.

Pete

Tony Johansson

unread,
Nov 7, 2009, 6:21:37 AM11/7/09
to
This was strange.
I use Red Gates's .NET Reflector.
Version on mscorlib.dll is 4f9ab708-48fd-43f4-869a-008e7cb40aa8

I get QuickSort in this way.
1. Select mscorlib.dll
2. Select System
3. Select SorterObjectArray
4. Select QuickSort

Here is the text that can be read at the bottom left

internal void QuickSort(int left, int right);
Declaring Type: System.Array+SorterObjectArray
Assembly: mscorlib, Version=2.0.0.


I get the same result if I start form main using reflector and click until I
reach QuickSort
Have you any idea why I don't see the correct source code in Reflector

//Tony


Peter Duniho

unread,
Nov 7, 2009, 2:07:09 PM11/7/09
to
Tony Johansson wrote:
> This was strange.
> I use Red Gates's .NET Reflector.
> Version on mscorlib.dll is 4f9ab708-48fd-43f4-869a-008e7cb40aa8

That's a GUID. Technically, it's the unique number describing the
assembly, but IMHO the version information is more useful/understandable.

On my computer (Windows 7, .NET 3.5), the assembly version is
"2.0.50727.4927".

> I get QuickSort in this way.
> 1. Select mscorlib.dll
> 2. Select System
> 3. Select SorterObjectArray

Your step #3 shouldn't work. You should need to select Array first.

> 4. Select QuickSort
>
> Here is the text that can be read at the bottom left
>
> internal void QuickSort(int left, int right);
> Declaring Type: System.Array+SorterObjectArray
> Assembly: mscorlib, Version=2.0.0.
>
>
> I get the same result if I start form main using reflector and click until I
> reach QuickSort
> Have you any idea why I don't see the correct source code in Reflector

No, sorry I don't. At the very least, if you run Reflector on the exact
same computer where you produced the stack trace showing the call to
SwapIfGreaterWithItems(), it should produce a view of the assembly that
is consistent with the stack trace. The only reason it would/should be
different is if you are looking at a different assembly in Reflector
than you are using in your program.

That _could_ happen if you have multiple versions of the .NET assemblies
lying around on your computer. But _that_ shouldn't happen normally. A
person would have to intentionally clutter their computer like that, and
surely that's something you'd remember having done?

All that said, you can verify the exact file being used in both
Reflector and in the debugger. In Reflector, just select the DLL
itself, and the information pane will show you the file path.

In the debugger, it might be a little more tricky. You can easily see
the source of each DLL loaded in the process by, while debugging,
displaying the "Modules" debug window. But normally, a DLL like
mscorlib.dll is executed from the GAC and this won't match directly with
the path shown in Reflector.

Of course, if it turns out you're loading a version of mscorlib.dll
that's not in the GAC, then that's probably your problem right there.
:) But, if it's in the GAC, AFAIK the best you can do is look at the
entry in the .NET Framework 2.0 Configuration MMC plug-in, but the only
semi-unique identifier that goes with an assembly in the GAC is the
public key token, and I don't recall whether that changes each version
(for sure, it's not unique to the assembly, because lots of other
assemblies share the same public key token...but it might be unique for
the framework version).

Anyway, that's a long way of saying, no...I don't know why on your
computer the stack trace doesn't match what you see in Reflector.

Pete

Tony Johansson

unread,
Nov 8, 2009, 8:03:07 AM11/8/09
to
Hello!

Now I get the same contents as you have in QuickSort.
In the References in the solution Expolere I used this location
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
so I use this location in reflector now.

Earlier I used this location in reflector
Location:
%ProgramFiles%\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\

I just wonder how does the program Red Gate's Reflector decide which
assembly to use when there
exist several assembly for example System.dll and mscorlib.dll and these
assembly have differerent contents.

//Tony


"Peter Duniho" <no.pet...@no.nwlink.spam.com> skrev i meddelandet
news:%23Ri6B29...@TK2MSFTNGP02.phx.gbl...

Tony Johansson

unread,
Nov 8, 2009, 8:03:10 AM11/8/09
to
Hello!

Now I get the same contents as you have in QuickSort.
In the References in the solution Expolere I used this location
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
so I use this location in reflector now.

Earlier I used this location in reflector
Location:
%ProgramFiles%\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\

I just wonder how does the program Red Gate's Reflector decide which
assembly to use when there
exist several assembly for example System.dll and mscorlib.dll and these
assembly have differerent contents.

//Tony


"Peter Duniho" <no.pet...@no.nwlink.spam.com> skrev i meddelandet
news:%23Ri6B29...@TK2MSFTNGP02.phx.gbl...

Tony Johansson

unread,
Nov 8, 2009, 8:03:47 AM11/8/09
to
Hello!

Now I get the same contents as you have in QuickSort.
In the References in the solution Expolere I used this location
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
so I use this location in reflector now.

Earlier I used this location in reflector
Location:
%ProgramFiles%\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\

I just wonder how does the program Red Gate's Reflector decide which
assembly to use when there
exist several assembly for example System.dll and mscorlib.dll and these
assembly have differerent contents.

//Tony


"Peter Duniho" <no.pet...@no.nwlink.spam.com> skrev i meddelandet
news:%23Ri6B29...@TK2MSFTNGP02.phx.gbl...

Tony Johansson

unread,
Nov 8, 2009, 8:03:51 AM11/8/09
to
Hello!

Now I get the same contents as you have in QuickSort.
In the References in the solution Expolere I used this location
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
so I use this location in reflector now.

Earlier I used this location in reflector
Location:
%ProgramFiles%\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\

I just wonder how does the program Red Gate's Reflector decide which
assembly to use when there
exist several assembly for example System.dll and mscorlib.dll and these
assembly have differerent contents.

//Tony


"Peter Duniho" <no.pet...@no.nwlink.spam.com> skrev i meddelandet
news:%23Ri6B29...@TK2MSFTNGP02.phx.gbl...

0 new messages