System.Runtime.Serialization.SerializationException: 'Type 'DDS.Retcode_PreconditionNotMet'

2 posts / 0 new
Last post
Offline
Last seen: 1 month 3 weeks ago
Joined: 02/20/2020
Posts: 5
System.Runtime.Serialization.SerializationException: 'Type 'DDS.Retcode_PreconditionNotMet'

I'm creating integration tests for my DDS application. To acquire readers, writers I'm using configuration through QoS XMLs. When running two specific test cases from the total of 32 cases, the second case always fails. When debugging the code, there seems to be a problem in my configuration, but I can't seem to figure it out. There is an ErrorCode from DDS, but that generates a SerializationException:

Stacktrace:

nddsdotnet461.dll!DDS::NDataReaderListener::on_data_available(DDSDataReader* reader) Line 226
at f:\home\build3\rti\waveworks\ndds601\connextdds\dds_dotnet.1.0\srccpp\managed\managed_subscription.cpp(226)

Exception:

System.Runtime.Serialization.SerializationException: 'Type 'DDS.Retcode_PreconditionNotMet' in Assembly 'nddsdotnet461, Version=1.6.1.1, Culture=neutral, PublicKeyToken=f319a9351e41fb68' is not marked as serializable.'System.Runtime.Serialization.SerializationExceptionHResult=0x8013150C
Message=Type 'DDS.Retcode_PreconditionNotMet' in Assembly 'nddsdotnet461, Version=1.6.1.1, Culture=neutral, PublicKeyToken=f319a9351e41fb68' is not marked as serializable.
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>

My debugger is trying to open managed_subscription.cpp, but as far as I can tell that file is not available to me.

I would like to inspect this exception, since it will probably give a hint what I did wrong. How can I get DDS to serialize/log this exception?

Offline
Last seen: 1 month 3 weeks ago
Joined: 02/20/2020
Posts: 5

I've been able to get some more information by using the Event Window from the debugger. The exception I've posted above is a resulting exception. In the Event Window in Visual Studio, there is a previous exception:

- Exception Exception thrown: 'DDS.Retcode_PreconditionNotMet' in nddsdotnet461.dll ("sample contains invalid data") DDS.Retcode_PreconditionNotMet

This allowed me to both understand what was happening (accessing the data from a sample that contained disposed data) and where it was happening (a C# event handler). With this information I was able to make adjustments in the testcases (the second testcase was processing samples from the first testcase, which created an undesirable dependency between the tests),