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

Daniel Morgan danielmorgan at verizon.net
Mon Jan 23 20:12:51 EST 2006


I will answer myself.

Using app.config for an assembly in Microsoft .net 1.1 GAC requires the 
fully-qualified assembly name while mono 1.1 does not.

Modifing the section to include the fully-qualified name works.

<section name="providers" 
type="Mono.Data.ProviderSectionHandler,Mono.Data, Version=1.0.5000.0, 
Culture=neutral, PublicKeyToken=0738eb9f132ed756" />

Daniel Morgan wrote:

> 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)
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>




More information about the Mono-devel-list mailing list