Failed to compare two elements in the array (v1.1 vs v2.0 x64)

F

Frank Rizzo

I've had a windows service, that I've written and compiled with vs2003
and .net framework 1.1, running just fine on windows server 2003 for a
long while. Recently the service was installed on Windows Server 2003
64 bit with the 64-bit .NET 2.0 framework installed.

All of a sudden, my application, returns
System.InvalidOperationException: Failed to compare two elements in the
array for certain operations (like ArrayList.Sort and
ArrayList.BinarySearch, not exactly sure which one of these methods -
probably both). I think the problem is in the implementation of the
IComparer interface. I am not quite sure what exact line of code in the
IComparer implementation it happens in.

The error seems to be fairly random (happens like once in a while, but
at least once an hour, even the though the service is running
continuously). At least I don't see a pattern in it.

The interesting kicker is that if I install the 32-bit .NET 1.1
framework on that box, all the problems go away.

Has anyone heard any issues with migrating .net 1.1 apps to .net 2.0
64-bit? Or about this particular problem?

Thanks.
 
W

Willy Denoyette [MVP]

| I've had a windows service, that I've written and compiled with vs2003
| and .net framework 1.1, running just fine on windows server 2003 for a
| long while. Recently the service was installed on Windows Server 2003
| 64 bit with the 64-bit .NET 2.0 framework installed.
|
| All of a sudden, my application, returns
| System.InvalidOperationException: Failed to compare two elements in the
| array for certain operations (like ArrayList.Sort and
| ArrayList.BinarySearch, not exactly sure which one of these methods -
| probably both). I think the problem is in the implementation of the
| IComparer interface. I am not quite sure what exact line of code in the
| IComparer implementation it happens in.
|
| The error seems to be fairly random (happens like once in a while, but
| at least once an hour, even the though the service is running
| continuously). At least I don't see a pattern in it.
|
| The interesting kicker is that if I install the 32-bit .NET 1.1
| framework on that box, all the problems go away.
|
| Has anyone heard any issues with migrating .net 1.1 apps to .net 2.0
| 64-bit? Or about this particular problem?
|
| Thanks.

V1.1 (VS2003) applications do run as 32 bit aplications, unless they are
recompiled using the V2.0 compilers (or VS2005). That would mean that the
Framework V2.0 32 bit was already installed, and the issue is a V1.1 <->
V2.0 related and has nothing to do with 64 bit.

Willy.
 
F

Frank Rizzo

Willy said:
| I've had a windows service, that I've written and compiled with vs2003
| and .net framework 1.1, running just fine on windows server 2003 for a
| long while. Recently the service was installed on Windows Server 2003
| 64 bit with the 64-bit .NET 2.0 framework installed.
|
| All of a sudden, my application, returns
| System.InvalidOperationException: Failed to compare two elements in the
| array for certain operations (like ArrayList.Sort and
| ArrayList.BinarySearch, not exactly sure which one of these methods -
| probably both). I think the problem is in the implementation of the
| IComparer interface. I am not quite sure what exact line of code in the
| IComparer implementation it happens in.
|
| The error seems to be fairly random (happens like once in a while, but
| at least once an hour, even the though the service is running
| continuously). At least I don't see a pattern in it.
|
| The interesting kicker is that if I install the 32-bit .NET 1.1
| framework on that box, all the problems go away.
|
| Has anyone heard any issues with migrating .net 1.1 apps to .net 2.0
| 64-bit? Or about this particular problem?
|
| Thanks.

V1.1 (VS2003) applications do run as 32 bit aplications, unless they are
recompiled using the V2.0 compilers (or VS2005). That would mean that the
Framework V2.0 32 bit was already installed, and the issue is a V1.1 <->
V2.0 related and has nothing to do with 64 bit.

Right, that's the way I understand it as well. So are there issues with
1.1 apps running against 2.0 framework?
 
W

Willy Denoyette [MVP]

| Willy Denoyette [MVP] wrote:
| > | > | I've had a windows service, that I've written and compiled with vs2003
| > | and .net framework 1.1, running just fine on windows server 2003 for a
| > | long while. Recently the service was installed on Windows Server 2003
| > | 64 bit with the 64-bit .NET 2.0 framework installed.
| > |
| > | All of a sudden, my application, returns
| > | System.InvalidOperationException: Failed to compare two elements in
the
| > | array for certain operations (like ArrayList.Sort and
| > | ArrayList.BinarySearch, not exactly sure which one of these methods -
| > | probably both). I think the problem is in the implementation of the
| > | IComparer interface. I am not quite sure what exact line of code in
the
| > | IComparer implementation it happens in.
| > |
| > | The error seems to be fairly random (happens like once in a while, but
| > | at least once an hour, even the though the service is running
| > | continuously). At least I don't see a pattern in it.
| > |
| > | The interesting kicker is that if I install the 32-bit .NET 1.1
| > | framework on that box, all the problems go away.
| > |
| > | Has anyone heard any issues with migrating .net 1.1 apps to .net 2.0
| > | 64-bit? Or about this particular problem?
| > |
| > | Thanks.
| >
| > V1.1 (VS2003) applications do run as 32 bit aplications, unless they are
| > recompiled using the V2.0 compilers (or VS2005). That would mean that
the
| > Framework V2.0 32 bit was already installed, and the issue is a V1.1 <->
| > V2.0 related and has nothing to do with 64 bit.
|
| Right, that's the way I understand it as well. So are there issues with
| 1.1 apps running against 2.0 framework?
|
|

I'm afraid I wasn't clear when I said your application would run as 32 bit.
An application will load the CLR and FCL it was build against, so if your
application was build using V1.1, it will load V1.1 unless you have a
configuration file that specifies to load a newer version, if it was build
against V2 it will load V2, it can't load any lower version.

Now in your case, you said you have a V1.1 service, now the question is do
you have a configuration file that specifies the required runtime?
If the answer is *no*, your service needs v1.1 to run, and has always run
against V1.1, so I don't see why 'installing V1.1' would have changed
anything.
If the answer is *yes* and you have specified V2 as the required or
supported runtime, your service will run against V2 as a 32 bit application,
V1.1 builds cannot run against V2 64 bit.

Willy.
 

Ask a Question

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

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

Ask a Question

Top