I’ve install mono-runtime via apt in order to run my Mono console application on Ubuntu via SSH. However, when I run the command mono myapp.exe, It exits, with no message, and my program does nothing.
If I throw the -v switch to Mono, such as mono -v myapp.exe, I get about 10k lines of output (as expected, -v is verbose), with the first few lines being:
converting method System.OutOfMemoryException:.ctor (string)
Method System.OutOfMemoryException:.ctor (string) emitted at 0xb7052c28 to 0xb7052c4b (code length 35) [myapp.exe]
converting method (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)
Method (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr) emitted at 0xb7052c68 to 0xb7052cf6 (code length 142) [myapp.exe]
converting method System.SystemException:.ctor (string)
I read this as the runtime throwing an OutOfMemory exception, but the machine is under no intense load, has plenty of available RAM, and is running nothing other that system processes.
I’ve removed and reinstalled Mono countless times, and have even run the executable on other machines perfectly fine.
Am I missing something completely obvious here?
EDIT:
Per @lupus‘s answer, here is a dump of log4net’s internal happenings. I don’t see anything wrong with it:
log4net: log4net assembly [log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a]. Loaded from [/mnt/ebs/911dispatch/scrapers/WA/Seattle/log4net.dll]. (.NET Runtime [4.0.30319.1] on Unix 3.0.0.12)
log4net: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository for assembly [Seattle911.Backend.Scraper, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]
log4net: Assembly [Seattle911.Backend.Scraper, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [/mnt/ebs/911dispatch/scrapers/WA/Seattle/Seattle911.Backend.Scraper.exe]
log4net: Assembly [Seattle911.Backend.Scraper, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.
log4net: Assembly [Seattle911.Backend.Scraper, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository for assembly [Seattle911.DAL, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]
log4net: Assembly [Seattle911.DAL, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [/mnt/ebs/911dispatch/scrapers/WA/Seattle/Seattle911.DAL.dll]
log4net: Assembly [Seattle911.DAL, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.
log4net: Assembly [Seattle911.DAL, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: repository [log4net-default-repository] already exists, using repository type [log4net.Repository.Hierarchy.Hierarchy]log4net: Shutdown called on Hierarchy [log4net-default-repository]
You’re using a log framework that will call Environment.Exit on fatal errors (this seems to be a connection error to the postgres database, maybe incorrect address/port or misconfigured server?).
You should configure log4net to not do that or check where it puts the log for the exact error your application hit and correct it.