.. include:: /../getting_started/vars.rst .. _section-Product-Codegen-700: RTI Code Generator ****************** C# code generation for optional sequences not supported ======================================================= *Code Generator* now fails for optional sequences in C#. Previously, the optional annotation was silently ignored for sequences in C#. Now, *Code Generator* will fail if the IDL/XML/XSD file contains an optional sequence. For example, this IDL will now fail for C#: .. code-block:: omg-idl struct MyStruct { @optional sequence mySquence; }; This problem is a known issue that will be fixed in a future release. For now, the workaround is to use an empty sequence to emulate an unset optional. For example, for the following IDL: .. code-block:: omg-idl struct Foo { sequence mySquence; }; Suppose |CONNEXT| published the following: .. code-block:: text var sample = new Foo(); sample.mySquence.Add(5); writer.Write(sample); sample.mySquence.Clear(); writer.Write(sample); After clearing the sequence in the fourth line, the fifth line will publish an empty sequence, which will emulate an unset optional. .. MG-108