[Mono-dev] Using assembly in GAC fails but runs okay in same path as executable

Daniel Morgan danielmorgan at verizon.net
Mon Jan 23 19:50:38 EST 2006

I'm having a problem with Mono.Data.dll on Dot NET 1.1.

You can use the DLL compiled with mcs or csc:
- both will fail when run from the GAC
- both will work when run from the same subdirectory the executable 
assembly is run

This is how I build on Dot Net:
cd mcs\class\Mono.Data
csc /target:library /out:Mono.Data.dll *.cs ..\..\build\common\Consts.cs 
/r:System.Data.dll /r:System.Xml.dll /d:NET_1_1
sn.exe -R Mono.Data.dll ../mono.snk

So, in order to get sqlsharpgtk to work on Dot Net, I had to place 
Mono.Data.dll wherever sqlsharpgtk.exe is located.

I do not know why Mono.Data.dll fails when loaded from the Dot Net GAC.  
It works fine from Mono's GAC.

sqlsharpgtk.exe uses the ProviderFactory in Mono.Data and 
sqlsharpgtk.exe.config to list and load data providers.

Any idea why?


Unhandled Exception: System.TypeInitializationException: The type 
initializer fo
r "Mono.Data.ProviderFactory" threw an exception. ---> 
igurationException: Could not create 
  at System.Configuration.ConfigurationRecord.GetFactory(String configKey)
  at System.Configuration.ConfigurationRecord.Evaluate(String configKey)
  at System.Configuration.ConfigurationRecord.ResolveConfig(String 
  at System.Configuration.ConfigurationRecord.GetConfig(String configKey)
igurationSystem.GetConfig(String configKey)
  at System.Configuration.ConfigurationSettings.GetConfig(String 
  at Mono.Data.ProviderFactory..cctor()
  --- End of inner exception stack trace ---
  at Mono.Data.ProviderFactory.get_Providers()
  at Mono.Data.SqlSharp.GtkSharp.LoginDialog.PopulateProviders()
  at Mono.Data.SqlSharp.GtkSharp.LoginDialog..ctor(SqlSharpGtk sqlSharpGtk)
  at Mono.Data.SqlSharp.GtkSharp.SqlSharpGtk.Main(String[] args)

More information about the Mono-devel-list mailing list