jonpryor / dblinq2007

Automatically exported from code.google.com/p/dblinq2007
0 stars 0 forks source link

DbLinq not loading assemblies from the GAC in Mono #205

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There's a workaround for Microsoft .NET when calling to Type.Load, but that 
does not work on Mono.

That code is located in this method:
DbMetal.Generator.Implementation.SchemaLoaderFactory.GacLoadAssembly(string)

Original issue reported on code.google.com by juan...@gmail.com on 22 Feb 2010 at 12:47

GoogleCodeExporter commented 9 years ago
same problem here. clearly GacLoadAssembly(string) it's just a windows 
implementation.
In ubuntu I've this exception:
DbMetal failed:System.ArgumentNullException: Argument cannot be null.
Parameter name: path1
  at System.IO.Path.Combine (System.String path1, System.String path2) [0x00000] 
  at DbMetal.Generator.Implementation.SchemaLoaderFactory.GacLoadAssembly 
(System.String shortName) [0x00000] 
  at 
DbMetal.Generator.Implementation.SchemaLoaderFactory.CurrentDomain_AssemblyResol
ve 
(System.Object sender, System.ResolveEventArgs args) [0x00000] 
  at System.AppDomain.DoAssemblyResolve (System.String name, Boolean refonly) 
[0x00000] 
  at (wrapper managed-to-native) System.Type:internal_from_name (string,bool,bool)
  at System.Type.GetType (System.String typeName) [0x00000] 
  at DbMetal.Generator.Implementation.SchemaLoaderFactory.Load (DbMetal.Parameters 
parameters, System.String dbLinqSchemaLoaderTypeName, System.String 
databaseConnectionTypeName, System.String sqlDialectTypeName) [0x00000] 
  at DbMetal.Generator.Implementation.SchemaLoaderFactory.Load (DbMetal.Parameters 
parameters) [0x00000] 
  at DbMetal.Generator.Implementation.Processor.ReadSchema (DbMetal.Parameters 
parameters, ISchemaLoader& schemaLoader) [0x00000] 
  at DbMetal.Generator.Implementation.Processor.ProcessSchema (DbMetal.Parameters 
parameters) [0x00000] 

Original comment by pedro.ra...@gmail.com on 9 Mar 2010 at 5:47

GoogleCodeExporter commented 9 years ago
Which is yet another sign that I should rip out that code entirely.

The intent of the GacLoadAssembly() code is to grab the most recent version of 
an 
assembly name.  However, the "most recent version" could have a completely 
different 
primary version number, meaning a (potentially) completely different API, 
meaning 
complete madness in trying to use it.

The fix is to not rely on something as brittle as "version-independent assembly 
names", but instead to require full assembly-qualified type names.

Task: Remove this @#$%#@% GAC code (and provide a better error message 
specifying 
what type it's trying to load).

Original comment by jonmpr...@gmail.com on 10 Mar 2010 at 9:33

GoogleCodeExporter commented 9 years ago

Original comment by jonmpr...@gmail.com on 18 Mar 2010 at 7:30