[Mono-dev] Problem in running an EXE (mono + Npgsql +PostgreSQL + Linux)

Robert Jordan robertj at gmx.net
Tue Dec 16 10:28:44 EST 2008


Ramprasad G wrote:
> Hello,
> I am using *Mono* in Linux 32-bit Ubuntu.,I want to connect to PostgreSQL
> 8.3 database server using Npgsql driver

[...]

> I am able to compile the CS code  using mcs.
> 
> * mcs SimpleExample.cs -r:System.Data -r:Npgsql.dll*


"Npgsql.dll" appears to be a .NET 2.0 assembly, so you have
to compile your test with "gmcs".

> It creates an EXE named SimpleExample.exe,then i tried to run that EXE using
> mono
> 
> *mono SimpleExample.exe*
> 
> It throws the following error
> 
> *** (SimpleExample.exe:18076): WARNING **: The class
> System.Data.Common.DbConnection could not be loaded, used in System.Data,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
> 
> Unhandled Exception: System.TypeLoadException: Could not load type
> 'System.InvalidProgramException' from assembly 'mscorlib,
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.*

Robert



More information about the Mono-devel-list mailing list