[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?

E:\cygwin\home\Administrator\monosvn\sqlsharpgtk\sqlsharpgtk>sqlsharpgtk

Unhandled Exception: System.TypeInitializationException: The type 
initializer fo
r "Mono.Data.ProviderFactory" threw an exception. ---> 
System.Configuration.Conf
igurationException: Could not create 
Mono.Data.ProviderSectionHandler,Mono.Data
  at System.Configuration.ConfigurationRecord.GetFactory(String configKey)
  at System.Configuration.ConfigurationRecord.Evaluate(String configKey)
  at System.Configuration.ConfigurationRecord.ResolveConfig(String 
configKey)
  at System.Configuration.ConfigurationRecord.GetConfig(String configKey)
  at 
System.Configuration.DefaultConfigurationSystem.System.Configuration.IConf
igurationSystem.GetConfig(String configKey)
  at System.Configuration.ConfigurationSettings.GetConfig(String 
sectionName)
  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