top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Why am I getting an InvalidOperationException when I serialize an ArrayList?

0 votes
251 views
Why am I getting an InvalidOperationException when I serialize an ArrayList?
posted Jan 27, 2016 by Latha

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

XmlSerializer needs to know in advance what type of objects it will find in an ArrayList. To specify the type, use the XmlArrayItem attibute like this:

public class Person
{
public string Name;
public int Age;
}

public class Population
{
[XmlArrayItem(typeof(Person))] public ArrayList People;
}
answer Jan 27, 2016 by Shivaranjini
Similar Questions
0 votes

I am working CGI project using C programming and I am reading the login detail in form input fields and when I try to submit the form with empty fields it gives me 502 Bad Gateway CGI was not in CGI/1.1 complaint.note that i am redirecting to the same page I am reading the the fields.

+2 votes

I have function in python,(Assume that i have imported all necessary module),

 def DL_Iperf(args):
        ssh=paramiko.SSHClient()
        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        ssh.connect(server_ip,username="root",password=Password)
some_code

This function is actually a thread and it will be created as many no of UE i have, (Ex: if i have 1 UE than 1 Thread will be created),

So, if i have 1 UE/ 2 UE than its working but if i have 3 UE then it is failing, with error "Paramiko : Error reading SSH protocol banner",

Below is the stderr of the script,

    No handlers could be found for logger "paramiko.transport"

    Unhandled exception in thread started by <function DL_Iperf at 0x02B8ACF0>
    Traceback (most recent call last):

    File "C:\Users\qxdm-5\Desktop\Chirag\LTE_11_Perfect_Working\TCP_Latest_2\Windo
    ws_UE\slave.py", line 379, in DL_Iperf

    ssh.connect(ServerIp,username="root",password=Pwd)

    File "build\bdist.win32\egg\paramiko\client.py", line 295, in connect

    File "build\bdist.win32\egg\paramiko\transport.py", line 451, in start_client

paramiko.SSHException: Error reading SSH protocol banner

From some reference i found that this is because of some network related issue, but my question is if it network related then why everytime in 3rd call of the function i am getting this error? And how do i resolve it?

+2 votes

I am writing the code without main function.

#include<stdio.h>
_start()
{
int a=10,b=20,res;
res=a+b;
printf("Res = %d\n",res);
}

Compiling : cc -nostartfiles filename.c

Output:

Res = 30
Segfault
+2 votes

user:~$ kdenlive
qrc:/qml/kdenliveclipmonitor.qml:2:1: module "QtQuick.Controls.Styles" is not installed
qrc:/qml/kdenliveclipmonitor.qml:1:1: module "QtQuick.Controls" is not installed
qrc:/qml/kdenliveclipmonitor.qml:2:1: module "QtQuick.Controls.Styles" is not installed
qrc:/qml/kdenliveclipmonitor.qml:1:1: module "QtQuick.Controls" is not installed
Segmentation fault (core dumped)

...