Given that bugzilla.novell.com doesn't really have any appropriate
categories, this is currently it. I'll need to look into adding
appropriate bugzilla support.
> Could not load dbLinqSchemaLoaderType type
> 'DbLinq.SqlServer.SqlServerSchemaLoader, System.Data.Linq,
> Version=3.5.0.0, Culture=neutral [...]. Try using the --with-schema-
> loader=TYPE option.
So apparently I was an idiot when I was merging DbLinq and mono, as I
included SqlServerSchemaLoader in the trunk build but not the mono-2-6
build. Doh!
I just fixed this:
http://github.com/mono/mono/commit/7fa99d845fe8024ccb91580d554c66e1d7a5d448
So it should appear in Mono 2.6.8, but that doesn't really help you
now...
For now, you can download a just-built System.Data.Linq.dll which
contains the needed support from:
http://www.jprl.com/tmp/System.Data.Linq.dll
http://www.jprl.com/tmp/System.Data.Linq.dll.mdb
Just overwrite the current files in
e.g. /usr/lib/mono/gac/System.Data.Linq/3.5.0.0__b77a5c561934e089
(change the prefix as appropriate) with the files above, and sqlmetal
should work for you.
Sorry for the inconvenience.
- Jon
Just as a basic sanity measure, are you sure you're running your app via
Mono and not .NET? I don't have the Windows install around to quickly
test on, but if you just use 'sqlmetal.exe' at the command line you'll
be using the .NET runtime, which will then attempt to load .NET's
System.Data.Linq.dll, which will fail to find any DbLinq types (for
~obvious reasons). You'll need to ensure that 'mono sqlmetal.exe' is
being used when using Mono's sqlmetal.exe.
(I suppose a sqlmetal.bat might be shipped to ensure that mono is being
used, but iirc .exe files are preferred to .bat files, so 'sqlmetal'
will load sqlmetal.exe, not sqlmetal.bat...)
- Jon
%PATH% is irrelevant. All that matters is which runtime is used to load
sqlmetal.exe, and if 'sqlmetal.exe' is in your path, then .NET will be
used to execute it when you just use 'sqlmetal' and/or 'sqlmetal.exe'.
(IIRC, .bat in the path won't help, as the .exe has precedence over
the .bat unless you run 'sqlmetal.bat', and I don't know if a .bat
or .cmd is present anyway...)
Thus, you'd either need to completely uninstall .NET (;-) or make sure
you use mono by running 'mono path\to\mono\sqlmetal.exe'.
Or perhaps running 'sqlmetal.cmd' (assuming it exists...).
Alternatively, download the DbLinq binary package and use DbMetal.exe.
You can run DbMetal-generated output under Mono by compiling with the
MONO_STRICT #define.
- Jon
I didn't know you were trying the updated DLLs. I somehow missed that.
Are you sure you're replacing the System.Data.Linq.dll assembly that's
in Mono's GAC? That should work, as
monodis --typedef System.Data.Linq.dll
shows that the type DbLinq.SqlServer.SqlServerSchemaLoader is present
within that assembly (unlike the 2.6.7 System.Data.Linq.dll), so it
should work. If it doesn't, either it's some other error, or you're not
replacing the assembly within Mono's GAC.
- Jon
Windows' lack of symbolic links sucks. :-)
Specifically, on Unix, there are two sets of assemblies:
$prefix/lib/mono/gac/System.Data.Linq/VERSION/System.Data.Linq.dll
$prefix/lib/mono/2.0/System.Data.Linq.dll
The latter is a symlink to the former. [0]
Since Windows doesn't (normally) have symbolic links, thus those are two
separate files.
Worse, sqlmetal.exe is in...$prefix/lib/mono/2.0, and thus by the normal
assembly resolution rules, it loads the *copy* in $prefix/lib/mono/2.0
rather than using the GAC version.
Thus, the fix is simple: Copy
http://www.jprl.com/tmp/System.Data.Linq.dll
to
C:\PROGRA~1\MONO-2~1.7\lib\mono\2.0\
Things should work for you then. (At least, I no longer get the "Could
not load dbLinqSchemaLoaderType..." message anymore.)
- Jon
[0] This is actually not much different from .NET, where the GAC has one
copy of the assembly, and %WINDIR%\Microsoft.NET\Framework\... has
another copy. Then C:\Program Files*\...\Reference Assemblies\ has yet
another. There may be a fourth copy somewhere else.
Remember: the C# compiler does NOT look for assemblies in the GAC.
Copy:
http://www.jprl.com/tmp/System.Data.Linq.dll
to:
C:\PROGRA~1\MONO-2~1.7\lib\mono\2.0\
Background:
There are (at least) two copies of a framework assembly: the copy in the
GAC (Mono: $prefix/lib/mono/gac/...) and a copy where the C# compiler
can reference it (Mono: $prefix/lib/mono/VERSION).
Since Windows doesn't (normally) support symbolic links, these are two
separate files (while on Linux the latter is a symlink to the former).
Furthermore, Mono's sqlmetal.exe is in $prefix/lib/mono/VERSION, and (as
per normal assembly resolution rules) it loads the
$prefix/lib/mono/VERSION version BEFORE it checks the GAC.
Result: just updating the System.Data.Linq.dll in the GAC won't fix
sqlmetal, as that's loading a different version.
- Jon
On Wed, 2010-09-29 at 14:38 -0700, Sandro wrote:
All I can suggest is two things:
1. Use -c "CONNECTION_STRING" instead of /user, /password, etc.
2. You may need to configure SQL Server to allow access. Here's the
handy dandy "omfg that's gigantically long are you kidding me"
tutorial I wrote for getting a Mono-hosted NerdDinner app to
connect to a Windows-hosted SQL Server instance:
Hopefully that's not entirely obsolete...
I imagine you'll need (5)(C), (5)(D), and (5)(E).
- Jon