Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load type from assembly in Mono

Tags:

mono

dll

I'm running a pre-built application using Mono, and it runs alongside a DLL in the same directory (mysql.data.dll). When I run the application with Mono, I get this error:

Could not load type 'Snowlight.Storage.SqlDatabaseClient' from assembly 'Snowlight, Version=0.1.0.35857, Culture=neutral, PublicKeyToken=null'.
  at System.Collections.Generic.Dictionary`2[System.Int32,Snowlight.Storage.SqlDatabaseClient].Init (Int32 capacity, IEqualityComparer`1 hcp) [0x00000] in <filename unknown>:0
  at System.Collections.Generic.Dictionary`2[System.Int32,Snowlight.Storage.SqlDatabaseClient]..ctor () [0x00000] in <filename unknown>:0
  at Snowlight.Storage.SqlDatabaseManager.Initialize () [0x00000] in <filename unknown>:0
  at Snowlight.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

Judging by <filename unknown>, I am assuming this happens because the DLL it requires isn't found, so how would I get the application to recognize it and use it?

like image 507
user1417933 Avatar asked Jun 03 '12 16:06

user1417933


1 Answers

Try running it like this from a terminal:

export MONO_LOG_LEVEL=debug
export MONO_LOG_MASK=asm
mono --debug yourapp.exe

Now every assembly lookup will be printed to the terminal, so you'll be able to find out what's being looked for where.

like image 159
Rolf Bjarne Kvinge Avatar answered Nov 20 '22 10:11

Rolf Bjarne Kvinge