views:

1900

answers:

3

I'm using Mono 2.4 on the Ubiquity web hosting service.

I created a simple MVC tutioal applciation, linked here, and verified that it worked using all Microsoft tools.

Next, the application was updated to point to a MySQL server database running on my Ubiquity host. The application works great on a Microsoft based machine.

Now, I am trying to deploy the application to the mono server on Ubiquity.

I set System.Web.MVC so it will CopyLocal=true.

I deployed the application to the mono server.


I get this error:

Description: Error parsing a resource required to service this request. Review your source file and modify it to fix this error.

Parser Error Message: Assembly System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 not found Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433


I am guessing the problem could be...

A) The Entity framework is not supported in mono. I need to use something other than the Microsoft Data Entity Framework.

B) The public key token for the mono version of System.Data.Entity is not "b77a5c561934e089".

C) There is something else going on.


I tried setting CopyLocal=true for the System.Entity.Data dll. Thus, the Microsoft version of the DLL deployed to my mono server. I have doubts that this is legal. At any rate, that only produced the following error:

Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.


Question

Can somebody confirm that it is possible to use the Microsoft Entity Framework on Mono? I am probably going to migrate away from the Microsoft Entity Framework, per this comment in the Microsoft MVC tutorial linked above..

"The ASP.NET MVC framework is not tied to the Microsoft Entity Framework. You can create >your database model classes by taking advantage of a variety of Object Relational Mapping >(OR/M) tools including LINQ to SQL, Subsonic, and NHibernate."

However, for the sake of consistency, I would like to use the Microsoft Entity Framework on mono if that is possible.

+1  A: 

You should set CopyLocal = true for the System.Data.Entity assembly as well. You noted that you copied System.Web.MVC local, but never mentioned that you copied System.Data.Entity locally. You might also need to copy local any of the assemblies that System.Data.Entity depends upon that are not part of Mono.

jrista
Yes, I tried that. The MONO compiler failed with this cryptic message. >Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. I'm guessing that this is because the Microsoft version of System.Data.Entity isn't compiled to reference the core Mono libraries.
Allen
Yeah, it sounds like EF does not support Mono. I guess that is not surprising...EF is a massive and complex framework. Its possible there are system hooks and the like that make it non-portable. I would recommend looking into alternative OR mappers, as MVC has no direct dependency on any OR mapping frameworks. You might even look into LINQ to SQL, if your needs are simple. That is another Microsoft ORM, but it is a lot simpler than EF.
jrista
A: 

It looks like there is no support in Mono for EDF at the moment, but someone is working on it.

Pat
A: 

I can confirm that EntityFramework, Microsoft Chart Controls, and Microsoft Sync Framework do NOT work on mono on Linux, despite different claims from Microsoft and/or MS-employees.

That is because Sync Framwork uses pinvoke with a COM interop component, Microsoft Chart Controls has DirectorySeparator issues, and the EntityFramwork namespace is not ported to mono, yet. It is estimated that the EntityFramwork port will take 1 year at least, until it reaches alpha/beta stage.

EntityFramwork might work on the windows version of mono, as long as you set localcopy to true.

I advise you to use nhibernate instead.

Quandary