Support for Mono with dotconnect for postgresql
Posted: Fri 10 Dec 2010 19:42
According to the documentation, dotconnect for postgresql 4.65.54.0 should support mono 2.0. I have mono 2.4, while the program executes, the database access fails with the message below. This is a simple test program, when a button is pressed, does the following:
private void button1_Click(object sender, EventArgs e)
{
DataSourceModel1.DataSourceModel1Entities entities = new DataSourceModel1Entities();
var q = from a in entities.Tests select a;
dataGridView1.DataSource = q;
entities.Dispose();
}
The entity was created using the Entity Developer 2.50.50. I used visual studio 2008 to compile the program. What is going on here? Is this a matter of assembly versions, or does dotconnect not work with mono?
mono TestDotconnectMono.exe
** (TestDotconnectMono.exe:31220): WARNING **: Method ':_getFiberPtrId ()' in assembly '/home/netadmin/Desktop/untitled folder 2/TestDotconnectMono/TestDotconnectMono/bin/Release/System.Data.dll' contains native code that cannot be executed by Mono on this platform. The assembly was probably created using C++/CLI.
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Data.EntityClient.EntityConnection ---> System.TypeInitializationException: An exception was thrown by the type initializer for ---> .ModuleLoadException: The C++ module failed to load.
---> System.MissingMethodException: Method contains unsupported native code
at (wrapper managed-to-native) :_getFiberPtrId ()
at ..LanguageSupport._Initialize (.LanguageSupport* ) [0x00000] in :0
at ..LanguageSupport.Initialize (.LanguageSupport* ) [0x00000] in :0
--- End of inner exception stack trace ---
at ..LanguageSupport.Initialize (.LanguageSupport* ) [0x00000] in :0
at ..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at System.Data.EntityClient.EntityConnection..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at System.Data.Objects.ObjectContext.CreateEntityConnection (System.String connectionString) [0x00000] in :0
at System.Data.Objects.ObjectContext..ctor (System.String connectionString) [0x00000] in :0
at System.Data.Objects.ObjectContext..ctor (System.String connectionString, System.String defaultContainerName) [0x00000] in :0
at DataSourceModel1.DataSourceModel1Entities..ctor () [0x00000] in :0
at TestDotconnectMono.Form1.button1_Click (System.Object sender, System.EventArgs e) [0x00000] in :0
at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x00000] in :0
at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00000] in :0
at System.Windows.Forms.ButtonBase.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in :0
at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in :0
at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in :0
netadmin@mail1:~/Desktop/untitled folder 2/TestDotconnectMono/TestDotconnectMono/bin/Release>
private void button1_Click(object sender, EventArgs e)
{
DataSourceModel1.DataSourceModel1Entities entities = new DataSourceModel1Entities();
var q = from a in entities.Tests select a;
dataGridView1.DataSource = q;
entities.Dispose();
}
The entity was created using the Entity Developer 2.50.50. I used visual studio 2008 to compile the program. What is going on here? Is this a matter of assembly versions, or does dotconnect not work with mono?
mono TestDotconnectMono.exe
** (TestDotconnectMono.exe:31220): WARNING **: Method ':_getFiberPtrId ()' in assembly '/home/netadmin/Desktop/untitled folder 2/TestDotconnectMono/TestDotconnectMono/bin/Release/System.Data.dll' contains native code that cannot be executed by Mono on this platform. The assembly was probably created using C++/CLI.
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Data.EntityClient.EntityConnection ---> System.TypeInitializationException: An exception was thrown by the type initializer for ---> .ModuleLoadException: The C++ module failed to load.
---> System.MissingMethodException: Method contains unsupported native code
at (wrapper managed-to-native) :_getFiberPtrId ()
at ..LanguageSupport._Initialize (.LanguageSupport* ) [0x00000] in :0
at ..LanguageSupport.Initialize (.LanguageSupport* ) [0x00000] in :0
--- End of inner exception stack trace ---
at ..LanguageSupport.Initialize (.LanguageSupport* ) [0x00000] in :0
at ..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at System.Data.EntityClient.EntityConnection..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at System.Data.Objects.ObjectContext.CreateEntityConnection (System.String connectionString) [0x00000] in :0
at System.Data.Objects.ObjectContext..ctor (System.String connectionString) [0x00000] in :0
at System.Data.Objects.ObjectContext..ctor (System.String connectionString, System.String defaultContainerName) [0x00000] in :0
at DataSourceModel1.DataSourceModel1Entities..ctor () [0x00000] in :0
at TestDotconnectMono.Form1.button1_Click (System.Object sender, System.EventArgs e) [0x00000] in :0
at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x00000] in :0
at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00000] in :0
at System.Windows.Forms.ButtonBase.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in :0
at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in :0
at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0
at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in :0
netadmin@mail1:~/Desktop/untitled folder 2/TestDotconnectMono/TestDotconnectMono/bin/Release>