Unable to execute .NET programs compiled against the v2.0 runtime: "Missing method System.Type::op_Inequality(Type,Type) in assembly /usr/lib/mono/2.0/mscorlib.dll"

Bug #884035 reported by Luis on 2011-10-31
40
This bug affects 6 people
Affects Status Importance Assigned to Milestone
gtk-sharp2 (Ubuntu)
Undecided
Unassigned

Bug Description

If you try to execute a .NET program not compiled against Mono 4.0 (but compiled against Mono 2.0 instead), when you try to run it you get many exception messages relative to missing methods, such as "Missing method System.Type::op_Inequality(Type,Type) in assembly /usr/lib/mono/2.0/mscorlib.dll".

More details here: <http://orangesquash.org.uk/~laney/blog/posts/2011/10/mono-gotcha/>

Temporary workaround:
Run the application passing the "--runtime=v4.0" switch to Mono, like this:
mono --runtime=v4.0 /usr/lib/myapp/myapp.exe
(where "/usr/lib/myapp/myapp.exe" is the complete path to the program you are trying to execute) to force Mono to use the v4.0 runtime.
-----
This is a sample scenario (running WepCrack):
luis@ubuntu:~$ sudo su
[sudo] password for luis:
root@ubuntu:/home/luis# cd Escritorio/WepCrack
root@ubuntu:/home/luis/Escritorio/WepCrack# sudo ./wepcrack
Missing method System.Type::op_Inequality(Type,Type) in assembly /usr/lib/mono/2.0/mscorlib.dll, referenced in assembly /usr/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll

Unhandled Exception: System.MissingMethodException: Method not found: 'System.Type.op_Inequality'.
  at WepCrackGtk.MainWindow..ctor () [0x00000] in <filename unknown>:0
  at GWepCrackGui.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method not found: 'System.Type.op_Inequality'.
  at WepCrackGtk.MainWindow..ctor () [0x00000] in <filename unknown>:0
  at GWepCrackGui.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
root@ubuntu:/home/luis/Escritorio/WepCrack#

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gnome-terminal 3.0.1-0ubuntu3
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic i686
ApportVersion: 1.23-0ubuntu3
Architecture: i386
Date: Sun Oct 30 21:28:04 2011
ExecutablePath: /usr/bin/gnome-terminal
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
SourcePackage: gnome-terminal
UpgradeStatus: Upgraded to oneiric on 2011-10-24 (6 days ago)

Luis (chiquitorey) wrote :
summary: - var/log/dist-upgrade/
+ Missing method System.Type::op_Inequality(Type,Type) in assembly
+ /usr/lib/mono/2.0/mscorlib.dll

Hi Luis, thanks for reporting.

From your description I've seen that you are encountering this error when you are using WepCrack. Could you please tell us if that happens with other .NET software too (or only with WepCrack), so that we can confirm that this is indeed a Mono bug and not only a WepCrack bug? Thanks!

affects: gnome-terminal (Ubuntu) → gtk-sharp2 (Ubuntu)
Changed in gtk-sharp2 (Ubuntu):
status: New → Incomplete
Luis (chiquitorey) wrote :

Hola:
         La verdad que soy nuevo en linux y nose que debería hacer para arreglar este error, hasta ahora el error me pasó con el wepcrack, pero igual cuando tengo actualizaciones para descargar me da error. Fuí a cambiar los repositorios y algunos descarga pero otros no, por ejemplo tambien me da este erro,E: samba4: el subproceso instalado el script post-installation devolvió el código de salida de error 1
Bueno espero que me puedan ayudar y agradezco su atención.

Julian Taylor (jtaylor) wrote :

This looks like the situation described here:
http://orangesquash.org.uk/~laney/blog/posts/2011/10/mono-gotcha/

try:
mono --runtime=v4.0 ./wepcrack

Alessandro Menti (elgaton) wrote :

Hi Luis,
thanks for replying.

In the future, could you please write in English, as that is the language used by most developers here? I have tried to translate your reply with an automatic translator, but I'm not sure it is really correct.

From what you have said, you are experiencing problems when you are using WepCrack as well as when you are installing updates. Those are two different and unrelated problems; here I try to solve the first, for the second you'd better ask for help on one of the following IRC channels: #ubuntu (English-speaking channel), #ubuntu-es (Spanish channel), #ubuntu-lat (for Latin America) or #ubuntu-mx (Mexican channel). If you are not comfortable at speaking English, try one of the latter three channel, as they are Spanish-speaking. You'll get real-time replies and assistance there. Look at <https://help.ubuntu.com/community/InternetRelayChat> for a list of programs you may use to connect to those channels, or just use the FreeNode webchat at <http://webchat.freenode.net/>.

To solve the problem, try the solution that Julian proposed: run the command "sudo mono --runtime=v4.0 ./wepcrack" instead of the "./wepcrack" that you use. Then, after you have tried that, could you please tell us if that worked for you? Thanks.

meliniak (maliniakh) wrote :

I've tried running it with:

mono --runtime=v4.0 ./wepcrack

but this in turn results in:

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Qyoto.QApplication ---> System.TypeInitializationException: An exception was thrown by the type initializer for Qyoto.SmokeInvocation ---> System.DllNotFoundException: /usr/lib/cli/qt-dotnet-4.5/libqyoto.so

The message is obvious. However libqyoto isn't available in any official repositories (if any at all). What would you recommend in this case? Compiling it by myself? Isn't this lib dependent on KDE libs which would require it to install KDE?

Alessandro Menti (elgaton) wrote :

You could try to use libqyoto from the repositories for Natty (see <http://packages.ubuntu.com/search?suite=all&searchon=names&keywords=qyoto>, choose the "natty-upgrades" series if present, otherwise just choose "natty"), since it seems that libqyoto was removed from Oneiric repositories. Try it and tell me if that works.

ok thank

2011/11/2 Alessandro Menti <email address hidden>

> You could try to use libqyoto from the repositories for Natty (see
> <http://packages.ubuntu.com/search?suite=all&searchon=names&keywords=qyoto
> >,
> choose the "natty-upgrades" series if present, otherwise just choose
> "natty"), since it seems that libqyoto was removed from Oneiric
> repositories. Try it and tell me if that works.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/884035
>
> Title:
> Missing method System.Type::op_Inequality(Type,Type) in assembly
> /usr/lib/mono/2.0/mscorlib.dll
>
> Status in “gtk-sharp2” package in Ubuntu:
> Incomplete
>
> Bug description:
> luis@ubuntu:~$ sudo su
> [sudo] password for luis:
> root@ubuntu:/home/luis# cd Escritorio/WepCrack
> root@ubuntu:/home/luis/Escritorio/WepCrack# sudo ./wepcrack
> Missing method System.Type::op_Inequality(Type,Type) in assembly
> /usr/lib/mono/2.0/mscorlib.dll, referenced in assembly
> /usr/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll
>
> Unhandled Exception: System.MissingMethodException: Method not found:
> 'System.Type.op_Inequality'.
> at WepCrackGtk.MainWindow..ctor () [0x00000] in <filename unknown>:0
> at GWepCrackGui.MainClass.Main (System.String[] args) [0x00000] in
> <filename unknown>:0
> [ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method
> not found: 'System.Type.op_Inequality'.
> at WepCrackGtk.MainWindow..ctor () [0x00000] in <filename unknown>:0
> at GWepCrackGui.MainClass.Main (System.String[] args) [0x00000] in
> <filename unknown>:0
> root@ubuntu:/home/luis/Escritorio/WepCrack#
>
> ProblemType: Bug
> DistroRelease: Ubuntu 11.10
> Package: gnome-terminal 3.0.1-0ubuntu3
> ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
> Uname: Linux 3.0.0-12-generic i686
> ApportVersion: 1.23-0ubuntu3
> Architecture: i386
> Date: Sun Oct 30 21:28:04 2011
> ExecutablePath: /usr/bin/gnome-terminal
> InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386
> (20101007)
> SourcePackage: gnome-terminal
> UpgradeStatus: Upgraded to oneiric on 2011-10-24 (6 days ago)
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/gtk-sharp2/+bug/884035/+subscriptions
>

Hi!

I encountered a similar error trying to run TheLastRipper (package no longer available in Ubuntu 11.10). Solution in that case was to start the program forcing it to use mono-runtime 4.0,

mono ---runtime=v4.0 /usr/local/lib/thelastripper/TheLastRipper.exe

Probably works for similar mono problems as well, and it seems to be a "general" problem with mono programs not packaged for Oneiric (see http://orangesquash.org.uk/~laney/blog/posts/2011/10/mono-gotcha/ )

so long
hank

Tognu (jaalvarez) wrote :

S O L V E D
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
In Ubuntu 11.10 for solve this error only is necesary build the next script

$ pico runwepcrack (with the next command)

gtksudo mono --runtime=v4.0 GWepCrackGui.exe

$chmod 777 runwepcrack

$./runwepcrack

Tognu (jaalvarez) wrote :

in my solution only change gtksudo by sudo or gksudo

Alessandro Menti (elgaton) wrote :

According to the page linked by Julian Taylor, it seems it's the single developers' responsibility to choose the correct compiler. I don't know if a workaround might be provided by default - I'm asking in the IRC channels for advice.

Changed in gtk-sharp2 (Ubuntu):
status: Incomplete → New
description: updated
summary: - Missing method System.Type::op_Inequality(Type,Type) in assembly
- /usr/lib/mono/2.0/mscorlib.dll
+ Unable to execute .NET programs compiled against the v2.0 runtime:
+ "Missing method System.Type::op_Inequality(Type,Type) in assembly
+ /usr/lib/mono/2.0/mscorlib.dll"
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gtk-sharp2 (Ubuntu):
status: New → Confirmed
Artem Fedyuk (terminsoft) wrote :

One of the reasons for this error:
(Missing method System.Type::op_Inequality(Type,Type) in assembly- /usr/lib/mono/2.0/mscorlib.dll)
can be the presence of a "SomeApplication.config" file with saved user settings, the runtime version of which is wrong. For example, the prefix part of this file might look like this:

<?xml version="1.0"?>
<configuration>
<configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <section name="ConsTerm.Client.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
    </sectionGroup>
</configSections>

You should recompile the program to version 4 (if you have the source code) and remove the old version of "SomeApplication.config"

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers