[Mono-list] sqlmetal on Mono 2.6 preview

Jonathan Pryor jonpryor at vt.edu
Mon Dec 7 22:51:29 EST 2009

On Mon, 2009-12-07 at 19:42 -0500, Costantino Pipero wrote:
> No matter what syntax I try (I am trying to connect to a MySQL db
> called "adventureworks"), I get the same error.

As a side note, you're missing the /provider option, so you should
actually be seeing an error message about missing the /provider option,
not spew about a TypeLoadException.  That said...
> For example:
> C:\Program Files\Mono-2.6\lib\mono\2.0>sqlmetal /server:localhost:3306 /namespace:sdventureworks /code:AdventureWorks.cs /language:csharp

You're launching it wrong.  This will use .NET to start sqlmetal...

> returns 
> Unhandled Exception: System.TypeLoadException: Could not load type
> 'DbLinq.Facto
> ry.ObjectFactory' from assembly 'System.Data.Linq, Version=,
> Culture=neut
> ral, PublicKeyToken=b77a5c561934e089'.
>    at DbMetal.Program.Main(String[] args)

...and (obviously?) .NET's System.Data.Linq.dll won't contain

You need to use Mono to start sqlmetal, thus ensuring that Mono's class
library is used to launch the app, e.g.

        path\to\mono.exe path\to\sqlmetal.exe ...

 - Jon

More information about the Mono-list mailing list