Bug 127 - Calling a Remote method with a ref DataTable as argument causes a "InvalidOperationException: Operation is not valid due to the current state of the object" on the function return if a FilleSchema was called within this method.
Summary: Calling a Remote method with a ref DataTable as argument causes a "InvalidOpe...
Status: RESOLVED NORESPONSE
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-08-01 01:12 UTC by Kay Ackermann
Modified: 2018-03-13 11:07 UTC (History)
2 users (show)

Tags: Remoting, RPC, FillSchema
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Kay Ackermann 2011-08-01 01:12:08 UTC
A client tries to retrieve a DataTable or DataSet from a server through a MarshalByRefObject.

The method called on the server i.e. GetData(ref DataTable dataTable)
uses the DataTable and an existing SQL connection to fill the table with the schema and data before it returns.

On the client when the function call returns the following exception is thrown IF the server runs on mono. On .net (Windows 7) everything is fine. If the FillSchema call (on the server side) is removed the exception will not occur.

Mono version: 2.10.2-r1
running on gentoo with kernel 3.0.


InvalidOperationException: Operation is not valid due to the current state of the object

Server stack trace: 
  at System.Data.DataSet.WriteColumnAsElement (System.Xml.XmlWriter writer, XmlWriteMode mode, System.Data.DataColumn col, System.Data.DataRow row, DataRowVersion version) [0x00000] in <filename unknown>:0 
  at System.Data.DataSet.WriteTable (System.Xml.XmlWriter writer, System.Data.DataRow[] rows, XmlWriteMode mode, DataRowVersion version, Boolean skipIfNested) [0x00000] in <filename unknown>:0 
  at System.Data.DataSet.WriteTable (System.Xml.XmlWriter writer, System.Data.DataTable table, XmlWriteMode mode, DataRowVersion version) [0x00000] in <filename unknown>:0 
  at System.Data.DataSet.WriteIndividualTableContent (System.Xml.XmlWriter writer, System.Data.DataTable table, XmlWriteMode mode) [0x00000] in <filename unknown>:0 
  at System.Data.DataTable.GetObjectData (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData (System.Object obj, System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata, System.Object& data) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects (System.IO.BinaryWriter writer) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.MessageFormatter.WriteMethodResponse (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers, System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) [0x00000] in <filename unknown>:0 
  at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage (IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, System.IO.Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, System.IO.Stream& responseStream) [0x00000] in <filename unknown>:0
Comment 1 Miguel de Icaza [MSFT] 2012-03-12 22:46:35 UTC
Please provide a self-contained test case for bugs of this nature.
Comment 2 Marek Safar 2018-03-13 11:07:15 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and reopen the bug report.

Thank you!