Skip to content

Error 20 when trying to serialize a type with a pointer. #4

Description

@Bobbeo

I am trying to serialize an object that contains a pointer (SvnChangeItem from SharpSvn).

Exception message:
Error 20 : (internal) Can not create a TypeManager for type SharpSvn.SvnChangeItem.

Inner Exception message:
ArgumentException: The type 'svn_log_changed_path2_t*' may not be used as a type argument.

Example Code:

		void SerializeChangeItem(SvnChangeItem changeItem)
		{
			using (var s = new UniversalSerializerWinForm("serialized.uniser"))
			{
				s.Serialize(changeItem);
			}
		}

		private void Form1_Load(object sender, EventArgs e)
		{
			using (SvnClient client = new SvnClient())
			{
				Collection<SvnLogEventArgs> x = new Collection<SvnLogEventArgs>();
				client.GetLog(@"C:\Users\aarthur\F0123",new SvnLogArgs
					{
						Range = new SvnRevisionRange(SvnRevision.Zero, SvnRevision.Head)
					},out x);

				foreach (SvnLogEventArgs xx in x)
				{
					if (xx.ChangedPaths == null)
						continue;

					foreach (SvnChangeItem xxx in xx.ChangedPaths)
					{
						SerializeChangeItem(xxx);
					}
				}
			}
		}

The Exception occurs on the following line:
Type typed = L2GenericTypeManagerTypeDefinition.MakeGenericType(new Type[] { type });

The exception occurs because type.IsPointer is true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions